我正在使用PyMC3
和joblib
模块并行地将相同的multiprocessing
模型拟合到不同的数据集,但遇到一个奇怪的错误。
尽管该模型适合绝大多数数据集,但对于随机子集却失败了,这是错误消息:
Traceback (most recent call last):
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 418, in _process_worker
r = call_item()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 272, in __call__
return self.fn(*self.args, **self.kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 567, in __call__
return self.func(*args, **kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in __call__
for func, args, kwargs in self.items]
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in <listcomp>
for func, args, kwargs in self.items]
File "fit_ogle3_2002.py", line 80, in fit_event
pspl_model, alert_time = initialize_model(event)
File "/gpfs1/home/fb90/hierarchical/fit_albrow/model.py", line 88, in initialize_model
mean = f*F_base*mag + (1 - f)*F_base
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/tensor/var.py", line 155, in __mul__
return theano.tensor.mul(self, other)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 670, in __call__
no_recycling=[])
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 955, in make_thunk
no_recycling)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 858, in make_c_thunk
output_storage=node_output_storage)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1217, in make_thunk
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1157, in __compile__
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1624, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1148, in module_from_key
module = self._get_from_key(key)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1047, in _get_from_key
return self._get_module(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 720, in _get_module
self.module_from_name[name] = dlimport(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 317, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ModuleNotFoundError: No module named 'tmpttugnbtl'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "fit_ogle3_2002.py", line 153, in <module>
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 934, in __call__
self.retrieve()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 833, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 521, in wrap_future_result
return future.result(timeout=timeout)
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
ModuleNotFoundError: No module named 'tmpttugnbtl'
No module named 'tmpttugnbtl'
到底是什么意思:S?
我正在使用PyMC3的3.7
版和Theano的1.0.4
版。使用以下几行代码对代码进行了Parallellized
from joblib import Parallel, delayed
import multiprocessing
n_jobs = 32
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)