I am trying to implement a custom ItemList simply to merge some Image data with some tabular data. Right now I am simply trying to make it work with my custom classes and my custom ItemBase simply return the image data to test with a simple cnn model…
I didn’t want to rewrite all the custom logic inside ImageItemList and TabularList so internally my custom ItemList simply create them internally so that I can re-use them. The problem is that I seem to be getting a into a parallelism problem I think and getting a ForkingPickler broken pipe error message. Do you think that re-using existing ItemList inside a custom ItemList could be the problem? When I set num_worker=0, then lr_find seems to run, but very very slowly.
Here is my code:
And here is the exception I get while running learn.lr_find():
---------------------------------------------------------------------------
BrokenPipeError Traceback (most recent call last)
<ipython-input-19-c7a9c29f9dd1> in <module>
----> 1 learn.lr_find()
2 learn.recorder.plot()
c:\work\ml\fastai-dev\fastai\fastai\train.py in lr_find(learn, start_lr, end_lr, num_it, stop_div, wd)
30 cb = LRFinder(learn, start_lr, end_lr, num_it, stop_div)
31 a = int(np.ceil(num_it/len(learn.data.train_dl)))
---> 32 learn.fit(a, start_lr, callbacks=[cb], wd=wd)
33
34 def to_fp16(learn:Learner, loss_scale:float=512., flat_master:bool=False)->Learner:
c:\work\ml\fastai-dev\fastai\fastai\basic_train.py in fit(self, epochs, lr, wd, callbacks)
176 callbacks = [cb(self) for cb in self.callback_fns] + listify(callbacks)
177 fit(epochs, self.model, self.loss_func, opt=self.opt, data=self.data, metrics=self.metrics,
--> 178 callbacks=self.callbacks+callbacks)
179
180 def create_opt(self, lr:Floats, wd:Floats=0.)->None:
c:\work\ml\fastai-dev\fastai\fastai\utils\mem.py in wrapper(*args, **kwargs)
101
102 try:
--> 103 return func(*args, **kwargs)
104 except Exception as e:
105 if ("CUDA out of memory" in str(e) or
c:\work\ml\fastai-dev\fastai\fastai\basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
86 cb_handler.set_dl(data.train_dl)
87 cb_handler.on_epoch_begin()
---> 88 for xb,yb in progress_bar(data.train_dl, parent=pbar):
89 xb, yb = cb_handler.on_batch_begin(xb, yb)
90 loss = loss_batch(model, xb, yb, loss_func, opt, cb_handler)
~\Anaconda3\envs\fastai-master\lib\site-packages\fastprogress\fastprogress.py in __iter__(self)
63 self.update(0)
64 try:
---> 65 for i,o in enumerate(self._gen):
66 yield o
67 if self.auto_update: self.update(i+1)
c:\work\ml\fastai-dev\fastai\fastai\basic_data.py in __iter__(self)
69 def __iter__(self):
70 "Process and returns items from `DataLoader`."
---> 71 for b in self.dl: yield self.proc_batch(b)
72
73 @classmethod
~\Anaconda3\envs\fastai-master\lib\site-packages\torch\utils\data\dataloader.py in __iter__(self)
817
818 def __iter__(self):
--> 819 return _DataLoaderIter(self)
820
821 def __len__(self):
~\Anaconda3\envs\fastai-master\lib\site-packages\torch\utils\data\dataloader.py in __init__(self, loader)
558 # before it starts, and __del__ tries to join but will get:
559 # AssertionError: can only join a started process.
--> 560 w.start()
561 self.index_queues.append(index_queue)
562 self.workers.append(w)
~\Anaconda3\envs\fastai-master\lib\multiprocessing\process.py in start(self)
110 'daemonic processes are not allowed to have children'
111 _cleanup()
--> 112 self._popen = self._Popen(self)
113 self._sentinel = self._popen.sentinel
114 # Avoid a refcycle if the target function holds an indirect
~\Anaconda3\envs\fastai-master\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):
~\Anaconda3\envs\fastai-master\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):
~\Anaconda3\envs\fastai-master\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)
~\Anaconda3\envs\fastai-master\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 #
BrokenPipeError: [Errno 32] Broken pipe