2016-12-04 16 views
3

これは私の簡単なコードです。私の第1プログラムを実行しています。dask.distributedクラスタに接続するときのPickleエラー

from dask.distributed import Client 
client = Client('192.168.1.102:8786') 


def inc(x): 
    return x + 1 

x = client.submit(inc, 10) 
print(x.result()) 

このコマンドを使用してこのコードを実行しようとしている:

$python3 filename.py 

私はこのエラーをgeingています:

/usr/local/lib/python3.4/dist-packages/distributed/protocol/pickle.py 
- INFO - Failed to serialize <function inc at 0x7f678ad05840> Traceback (most recent call last): File 
"/usr/local/lib/python3.4/dist-packages/distributed/protocol/pickle.py", 
line 33, in dumps 
    return cloudpickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL) AttributeError: 'module' object has no attribute 'dumps' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): File 
"/usr/local/lib/python3.4/dist-packages/distributed/protocol/pickle.py", 
line 43, in dumps 
    return cloudpickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL) AttributeError: 'module' object has no attribute 'dumps' Traceback 
(most recent call last): File 
"/usr/local/lib/python3.4/dist-packages/distributed/protocol/pickle.py", 
line 33, in dumps 
    return cloudpickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL) AttributeError: 'module' object has no attribute 'dumps' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): File "dis.py", line 8, in 
<module> 
    x = client.submit(inc, 10) File "/usr/local/lib/python3.4/dist-packages/distributed/client.py", line 
643, in submit 
    loose_restrictions, priority={skey: 0}) File "/usr/local/lib/python3.4/dist-packages/distributed/client.py", line 
1235, in _graph_to_futures 
    'tasks': valmap(dumps_task, dsk3), File "/usr/local/lib/python3.4/dist-packages/toolz/dicttoolz.py", line 84, 
in valmap 
    rv.update(zip(iterkeys(d), map(func, itervalues(d)))) File "/usr/local/lib/python3.4/dist-packages/distributed/worker.py", line 
812, in dumps_task 
    return {'function': dumps_function(task[0]), File "/usr/local/lib/python3.4/dist-packages/distributed/worker.py", line 
779, in dumps_function 
    b = dumps(func) File "/usr/local/lib/python3.4/dist-packages/distributed/protocol/pickle.py", 
line 43, in dumps 
    return cloudpickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL) AttributeError: 'module' object has no attribute 'dumps' 

答えて

3

は、多くの場合、酸洗エラーが兆候あなたDASKのいくつかの要素ということです。分散ネットワーク(ワーカー、スケジューラー、またはクライアント)はPythonのバージョンが不一致です。おそらくあなたの労働者はあなたがそれを実現することなくPython 2の下で動いていますか?

このエラーは、特にcloudpickleライブラリにはdumpsという方法がないと言われています。これはかなり奇妙です。私が考える限り、cloudpickleは常にdumps機能を持っていた。あなたの環境に奇妙なクラウドピクルライブラリがあるのでしょうか、それとも非常に古いバージョンですか?

あなただけの物事をしようとしている場合は、私のコードはipythonがのpython3で働いていないBTにも実行されているスケジューラ

from dask.distributed import Client 

# client = Client('scheduler-address:8786') 
client = Client() # create local "cluster" 
+0

のアドレスをomitingして、同じプロセス内でローカルクラスタを起動することができます –

+0

私はまた、クライアント()からipを削除し、同じエラーが発生しました... 実際に何が起こっているのか分かりません...このコードはipythonでうまく動作しています –

+1

おそらくあなたは問題を抱えていますあなたのシステムのPythonで複数のPython環境を走らせる。代わりにAnacondaを試してみることができますか?この種の問題は消え去る傾向があります。 – MRocklin

関連する問題