You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/10 09:28:54 UTC

[GitHub] sliawatimena edited a comment on issue #8955: Can't pickle MXNet Modules

sliawatimena edited a comment on issue #8955: Can't pickle MXNet Modules
URL: https://github.com/apache/incubator-mxnet/issues/8955#issuecomment-428501426
 
 
   I am using windows 7, anaconda navigator 1.9.2, Python 3.6.6, Jupyter notebook 5.7.0, try to learn code from [Gluon crash course chapter 5](https://gluon-crash-course.mxnet.io/train.html). 
   
   I already add:
   import pickle
   
   I got stuck at 
   ```
   for data, label in train_data:
       print(data.shape, label.shape)
       break
   ---
   AttributeError                            Traceback (most recent call last)
   <ipython-input-8-91a66f98d1d2> in <module>()
   ----> 1 for data, label in train_data:
         2     print(data.shape, label.shape)
         3     break
   
   E:\Anaconda\envs\mxnet\lib\site-packages\mxnet\gluon\data\dataloader.py in __iter__(self)
       282         # multi-worker
       283         return _MultiWorkerIter(self._num_workers, self._dataset,
   --> 284                                 self._batchify_fn, self._batch_sampler)
       285 
       286     def __len__(self):
   
   E:\Anaconda\envs\mxnet\lib\site-packages\mxnet\gluon\data\dataloader.py in __init__(self, num_workers, dataset, batchify_fn, batch_sampler)
       142                 args=(self._dataset, self._key_queue, self._data_queue, self._batchify_fn))
       143             worker.daemon = True
   --> 144             worker.start()
       145             workers.append(worker)
       146 
   
   E:\Anaconda\envs\mxnet\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
   
   E:\Anaconda\envs\mxnet\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):
   
   E:\Anaconda\envs\mxnet\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):
   
   E:\Anaconda\envs\mxnet\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)
   
   E:\Anaconda\envs\mxnet\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 'Dataset.transform_first.<locals>.base_fn'
   ```
   
   please help. thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services