tdlearn icon indicating copy to clipboard operation
tdlearn copied to clipboard

'numpy.ndarray' object has no attribute 'mode'

Open xfdywy opened this issue 8 years ago • 1 comments

I setup the code by following your instruction. And I got an error when I try to run experiment/disc_random_on.py. Thanks for your help.

Traceback (most recent call last): File "experiments/disc_random_on.py", line 158, in mean, std, raw = run_experiment(n_jobs=-1, **globals()) File "/home/yuewang/rl_code/tdlearn/experiments/init.py", line 100, in run_experiment verbose=verbose, n_jobs=n_jobs, episodic=episodic) File "/home/yuewang/rl_code/tdlearn/task.py", line 100, in avg_error_traces res = Parallel(n_jobs=n_jobs, verbose=verbose)(jobs) File "/home/yuewang/rl_code/tdlearn/joblib/parallel.py", line 516, in call self.retrieve() File "/home/yuewang/rl_code/tdlearn/joblib/parallel.py", line 437, in retrieve self._output.append(job.get()) File "/home/yuewang/anaconda2/lib/python2.7/multiprocessing/pool.py", line 567, in get raise self._value AttributeError: 'numpy.ndarray' object has no attribute 'mode'

xfdywy avatar May 23 '17 06:05 xfdywy

I had the same issue and tracked it down to the custom joblib.pool: https://github.com/chrodan/joblib/blob/01611a53c2f2783ef80530bbcc146ef804f25e76/joblib/pool.py#L54.

I managed to get around this by replacing the MemmapingPool with multiprocessing.pool.Pool in the custom joblib here: https://github.com/chrodan/joblib/blob/01611a53c2f2783ef80530bbcc146ef804f25e76/joblib/parallel.py#L487.

Not an ideal solution, but got the code running.

hartikainen avatar Feb 16 '20 21:02 hartikainen