Dear @muellerzr and @lgvaz I finally started play around with Style Transfer and I was reproducing the code in this repository as you recommend. https://github.com/muellerzr/Practical-Deep-Learning-for-Coders-2.0/blob/master/Computer%20Vision/05_Style_Transfer.ipynb
I got this error when I did the
learn.fit_one_cycle(1, 1e-3)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-48-486c2b8b9d58> in <module>
----> 1 learn.fit_one_cycle(1, 1e-3)
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/callback/schedule.py in fit_one_cycle(self, n_epoch, lr_max, div, div_final, pct_start, wd, moms, cbs, reset_opt)
110 scheds = {'lr': combined_cos(pct_start, lr_max/div, lr_max, lr_max/div_final),
111 'mom': combined_cos(pct_start, *(self.moms if moms is None else moms))}
--> 112 self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd)
113
114 # Cell
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
193 try:
194 self.epoch=epoch; self('begin_epoch')
--> 195 self._do_epoch_train()
196 self._do_epoch_validate()
197 except CancelEpochException: self('after_cancel_epoch')
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in _do_epoch_train(self)
166 try:
167 self.dl = self.dls.train; self('begin_train')
--> 168 self.all_batches()
169 except CancelTrainException: self('after_cancel_train')
170 finally: self('after_train')
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in all_batches(self)
144 def all_batches(self):
145 self.n_iter = len(self.dl)
--> 146 for o in enumerate(self.dl): self.one_batch(*o)
147
148 def one_batch(self, i, b):
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/load.py in __iter__(self)
95 self.randomize()
96 self.before_iter()
---> 97 for b in _loaders[self.fake_l.num_workers==0](self.fake_l):
98 if self.device is not None: b = to_device(b, self.device)
99 yield self.after_batch(b)
/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/utils/data/dataloader.py in __next__(self)
343
344 def __next__(self):
--> 345 data = self._next_data()
346 self._num_yielded += 1
347 if self._dataset_kind == _DatasetKind.Iterable and \
/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self)
854 else:
855 del self._task_info[idx]
--> 856 return self._process_data(data)
857
858 def _try_put_index(self):
/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _process_data(self, data)
879 self._try_put_index()
880 if isinstance(data, ExceptionWrapper):
--> 881 data.reraise()
882 return data
883
/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/_utils.py in reraise(self)
392 # (https://bugs.python.org/issue2651), so we work around it.
393 msg = KeyErrorMessage(msg)
--> 394 raise self.exc_type(msg)
OSError: Caught OSError in DataLoader worker process 2.
Original Traceback (most recent call last):
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 34, in fetch
data = next(self.dataset_iter)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/load.py", line 106, in create_batches
yield from map(self.do_batch, self.chunkify(res))
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/utils.py", line 271, in chunked
res = list(itertools.islice(it, cs))
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/load.py", line 119, in do_item
try: return self.after_item(self.create_item(s))
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/load.py", line 125, in create_item
def create_item(self, s): return next(self.it) if s is None else self.dataset[s]
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/core.py", line 287, in __getitem__
res = tuple([tl[it] for tl in self.tls])
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/core.py", line 287, in <listcomp>
res = tuple([tl[it] for tl in self.tls])
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/core.py", line 264, in __getitem__
return self._after_item(res) if is_indexer(idx) else res.map(self._after_item)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/core.py", line 227, in _after_item
def _after_item(self, o): return self.tfms(o)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/transform.py", line 185, in __call__
def __call__(self, o): return compose_tfms(o, tfms=self.fs, split_idx=self.split_idx)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/transform.py", line 138, in compose_tfms
x = f(x, **kwargs)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/transform.py", line 72, in __call__
def __call__(self, x, **kwargs): return self._call('encodes', x, **kwargs)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/transform.py", line 82, in _call
return self._do_call(getattr(self, fn), x, **kwargs)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/transform.py", line 86, in _do_call
return x if f is None else retain_type(f(x, **kwargs), x, f.returns_none(x))
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/dispatch.py", line 98, in __call__
return f(*args, **kwargs)
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/vision/core.py", line 98, in create
return cls(load_image(fn, **merge(cls._open_args, kwargs)))
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/vision/core.py", line 75, in load_image
im.load()
File "/opt/conda/envs/fastai/lib/python3.7/site-packages/PIL/ImageFile.py", line 247, in load
"(%d bytes not processed)" % len(b)
**OSError: image file is truncated (43 bytes not processed)**
Maybe I could ask this question in another topic thread if this could be a common question?!
OSError: image file is truncated (43 bytes not processed)
I was able to achieve some results anyway
looking also at these threads https://github.com/eriklindernoren/PyTorch-YOLOv3/issues/162