Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ouwyukha opened this issue Jun 10, 2020 · 0 comments

Comments

@ouwyukha
Copy link

ouwyukha commented Jun 10, 2020

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'


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant