0

いくつかの大きな配列で実際の fft を実行しようとしていて、dask を試してみることにしました。関数 dask.array.rfft が何をしても機能しないように見えるという問題に遭遇しました。これは最小限の例です。

import numpy as np
import dask.array as da
import dask

print('Dask version: {}'.format(dask.__version__))

x = np.random.random((10, 10))
dx = da.from_array(x, chunks=(2, x.shape[1]))
dx_fft = da.fft.fft(dx)
dx_ifft = da.fft.ifft(dx_fft)
dx_ifft.compute()
print('Regular fft worked out just fine.')

dx = da.from_array(x, chunks=(2, x.shape[1]))
dx_rfft = da.fft.rfft(dx, axis=1)
dx_irfft = da.fft.irfft(dx_rfft, axis=1)
dx_irfft.compute()
print('Real fft worked out just fine.')

プログラムの出力は次のとおりです。

Dask version: 0.7.5
Regular fft worked out just fine.
Traceback (most recent call last):
  File "a.py", line 16, in <module>
    dx_irfft = da.fft.irfft(dx_rfft, axis=1)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/fft.py", line 35, in func
    chunks=chunks)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 449, in map_blocks
    result = atop(func, out_ind, *args, name=name, dtype=dtype)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1420, in atop
    chunkss, arrays = unify_chunks(*args)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1342, in unify_chunks
    for a, i in arginds]
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1141, in rechunk
    return rechunk(self, chunks)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/rechunk.py", line 232, in rechunk
    return Array(x2, temp_name, chunks, dtype=x.dtype)
  File "/home/heitor/anaconda/lib/python2.7/site-packages/toolz/functoolz.py", line 348, in memof
    raise TypeError("Arguments to memoized function must be hashable")
TypeError: Arguments to memoized function must be hashable

dx_rfft で何をしようとしても、同じエラーが返されます。私は Python 2 と 3 を試しましたが、どちらも同じ問題を抱えています。何か不足していますか、それともライブラリのバグですか?

4

1 に答える 1

1

これは、das master では発生しません。最も簡単な解決策は、おそらくそこからインストールすることです。これを行う最も簡単な方法は、

$ conda remove dask
$ pip install git+git://github.com/blaze/dask.git # might need root

または、新しい conda 環境を作成して、システム タスクを壊れている可能性のある開発バージョンに置き換える必要がないようにすることもできます。

$ conda create -n myenv dask  #create "myenv" environment and install dask + depedencies
$ source activate myenv
(myenv)$ conda remove dask
(myenv)$ pip install git+git://github.com/blaze/dask.git
于 2015-12-25T00:34:11.893 に答える