I’m getting this error while I try to run the exact same notebook of lesson 3 camvid in colab.
The first part is when I run this cell and the following warning appears:
data = (src.transform(get_transforms(), size=size, tfm_y=True)
.databunch(bs=bs)
.normalize(imagenet_stats))
You can deactivate this warning by passing `no_check=True`.
/usr/local/lib/python3.6/dist-packages/fastai/basic_data.py:224: UserWarning: There seems to be something wrong with your dataset, can't access any element of self.train_ds.
Tried: 343,297,143,412,495...
warn(warn_msg)
Then when I run the next cell data.show_batch(2,figsize=(10,7))
the following error appears:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-39-4672a3bbd9d5> in <module>()
----> 1 data.show_batch(2, figsize=(10,7))
/usr/local/lib/python3.6/dist-packages/fastai/basic_data.py in show_batch(self, rows, ds_type, **kwargs)
157 def show_batch(self, rows:int=5, ds_type:DatasetType=DatasetType.Train, **kwargs)->None:
158 "Show a batch of data in `ds_type` on a few `rows`."
--> 159 x,y = self.one_batch(ds_type, True, True)
160 if self.train_ds.x._square_show: rows = rows ** 2
161 xs = [self.train_ds.x.reconstruct(grab_idx(x, i)) for i in range(rows)]
/usr/local/lib/python3.6/dist-packages/fastai/basic_data.py in one_batch(self, ds_type, detach, denorm, cpu)
140 w = self.num_workers
141 self.num_workers = 0
--> 142 try: x,y = next(iter(dl))
143 finally: self.num_workers = w
144 if detach: x,y = to_detach(x,cpu=cpu),to_detach(y,cpu=cpu)
/usr/local/lib/python3.6/dist-packages/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
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __next__(self)
635 self.reorder_dict[idx] = batch
636 continue
--> 637 return self._process_next_batch(batch)
638
639 next = __next__ # Python 2 compatibility
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in _process_next_batch(self, batch)
656 self._put_indices()
657 if isinstance(batch, ExceptionWrapper):
--> 658 raise batch.exc_type(batch.exc_msg)
659 return batch
660
TypeError: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 138, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.6/dist-packages/fastai/data_block.py", line 566, in __getitem__
x = x.apply_tfms(self.tfms, **self.tfmargs)
File "/usr/local/lib/python3.6/dist-packages/fastai/vision/image.py", line 109, in apply_tfms
x.resize(target)
File "/usr/local/lib/python3.6/dist-packages/fastai/vision/image.py", line 185, in resize
self.flow = _affine_grid(size)
File "/usr/local/lib/python3.6/dist-packages/fastai/vision/image.py", line 528, in _affine_grid
grid = FloatTensor(N, H, W, 2)
TypeError: new(): argument 'size' must be tuple of ints, but found element of type numpy.float64 at pos 2