openrec icon indicating copy to clipboard operation
openrec copied to clipboard

AttributeError: Can't pickle local object 'RandomPairwiseSampler.<locals>.batch'

Open ouwyukha opened this issue 4 years ago • 0 comments

Hi, i got an error below when trying to run every tf1 models on tensorflow 1.4. Do you know what's the problem is? perhaps my tensorflow version is not supported?

AttributeError                            Traceback (most recent call last)
<ipython-input-33-3c464690e82a> in <module>
      4                     train_sampler=train_sampler,
      5                     eval_samplers=[val_sampler,test_sampler],
----> 6                     evaluators=[auc_evaluator])

~\.conda\envs\tf14\lib\site-packages\openrec\tf1\model_trainer.py in train(self, total_iter, eval_iter, save_iter, train_sampler, start_iter, eval_samplers, evaluators)
     63         self._eval_manager = EvalManager(evaluators=evaluators)
     64 
---> 65         train_sampler.reset()
     66         for sampler in eval_samplers:
     67             sampler.reset()

~\.conda\envs\tf14\lib\site-packages\openrec\tf1\utils\samplers\sampler.py in reset(self)
     49             runner = _Sampler(self._dataset, self._q, self._generate_batch)
     50             runner.daemon = True
---> 51             runner.start()
     52             self._runner_list.append(runner)
     53         self._start = True

~\.conda\envs\tf14\lib\multiprocessing\process.py in start(self)
    103                'daemonic processes are not allowed to have children'
    104         _cleanup()
--> 105         self._popen = self._Popen(self)
    106         self._sentinel = self._popen.sentinel
    107         # Avoid a refcycle if the target function holds an indirect

~\.conda\envs\tf14\lib\multiprocessing\context.py in _Popen(process_obj)
    221     @staticmethod
    222     def _Popen(process_obj):
--> 223         return _default_context.get_context().Process._Popen(process_obj)
    224 
    225 class DefaultContext(BaseContext):

~\.conda\envs\tf14\lib\multiprocessing\context.py in _Popen(process_obj)
    320         def _Popen(process_obj):
    321             from .popen_spawn_win32 import Popen
--> 322             return Popen(process_obj)
    323 
    324     class SpawnContext(BaseContext):

~\.conda\envs\tf14\lib\multiprocessing\popen_spawn_win32.py in __init__(self, process_obj)
     63             try:
     64                 reduction.dump(prep_data, to_child)
---> 65                 reduction.dump(process_obj, to_child)
     66             finally:
     67                 set_spawning_popen(None)

~\.conda\envs\tf14\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
     58 def dump(obj, file, protocol=None):
     59     '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60     ForkingPickler(file, protocol).dump(obj)
     61 
     62 #

AttributeError: Can't pickle local object 'RandomPairwiseSampler.<locals>.batch'


ouwyukha avatar Jun 10 '20 07:06 ouwyukha