I am getting this Runtime error while loading the model. I do not want to run the model all over again. Search Stackoverflow looks like some initialization error. Looks like ForkingPickler.load is failing. What is the solution of these types of error. Do I need to rerun the code. I thought once the model is created loading of model should not be a problem.
RuntimeError Traceback (most recent call last)
in ()
----> 1 log_preds, y = learn.TTA()
2 probs = np.exp(log_preds)
3 accuracy(log_preds,y), metrics.log_loss(y, probs)
~/fastai/courses/dl1/fastai/learner.py in TTA(self, n_aug, is_test)
148 dl1 = self.data.test_dl if is_test else self.data.val_dl
149 dl2 = self.data.test_aug_dl if is_test else self.data.aug_dl
–> 150 preds1,targs = predict_with_targs(self.model, dl1)
151 preds1 = [preds1]*math.ceil(n_aug/4)
152 preds2 = [predict_with_targs(self.model, dl2)[0] for i in range(n_aug)]
~/fastai/courses/dl1/fastai/model.py in predict_with_targs(m, dl)
115 if hasattr(m, ‘reset’): m.reset()
116 preda,targa = zip(*[(get_prediction(m(*VV(x))),y)
–> 117 for *x,y in iter(dl)])
118 return to_np(torch.cat(preda)), to_np(torch.cat(targa))
119
~/fastai/courses/dl1/fastai/model.py in (.0)
114 m.eval()
115 if hasattr(m, ‘reset’): m.reset()
–> 116 preda,targa = zip(*[(get_prediction(m(*VV(x))),y)
117 for *x,y in iter(dl)])
118 return to_np(torch.cat(preda)), to_np(torch.cat(targa))
~/fastai/courses/dl1/fastai/dataset.py in next(self)
226 if self.i>=len(self.dl): raise StopIteration
227 self.i+=1
–> 228 return next(self.it)
229
230 @property
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/data/dataloader.py in next(self)
193 while True:
194 assert (not self.shutdown and self.batches_outstanding > 0)
–> 195 idx, batch = self.data_queue.get()
196 self.batches_outstanding -= 1
197 if idx != self.rcvd_idx:
~/src/anaconda3/envs/fastai/lib/python3.6/multiprocessing/queues.py in get(self)
335 res = self._reader.recv_bytes()
336 # unserialize the data after having released the lock
–> 337 return _ForkingPickler.loads(res)
338
339 def put(self, obj):
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/multiprocessing/reductions.py in rebuild_storage_fd(cls, df, size)
68 fd = multiprocessing.reduction.rebuild_handle(df)
69 else:
—> 70 fd = df.detach()
71 try:
72 storage = storage_from_cache(cls, fd_id(fd))
~/src/anaconda3/envs/fastai/lib/python3.6/multiprocessing/resource_sharer.py in detach(self)
56 ‘’‘Get the fd. This should only be called once.’’'
57 with _resource_sharer.get_connection(self._id) as conn:
—> 58 return reduction.recv_handle(conn)
59
60
~/src/anaconda3/envs/fastai/lib/python3.6/multiprocessing/reduction.py in recv_handle(conn)
180 ‘’‘Receive a handle over a local connection.’’'
181 with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
–> 182 return recvfds(s, 1)[0]
183
184 def DupFd(fd):
~/src/anaconda3/envs/fastai/lib/python3.6/multiprocessing/reduction.py in recvfds(sock, size)
159 if len(ancdata) != 1:
160 raise RuntimeError(‘received %d items of ancdata’ %
–> 161 len(ancdata))
162 cmsg_level, cmsg_type, cmsg_data = ancdata[0]
163 if (cmsg_level == socket.SOL_SOCKET and
RuntimeError: received 0 items of ancdata