Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save manycoding/029221dfbb6c3d93cce137141ef1a57a to your computer and use it in GitHub Desktop.
Save manycoding/029221dfbb6c3d93cce137141ef1a57a to your computer and use it in GitHub Desktop.
fastai_audio size error
TypeError Traceback (most recent call last)
<ipython-input-25-78458082cfe6> in <module>
----> 1 learn.predict(test[-1])
/opt/conda/lib/python3.6/site-packages/fastai/basic_train.py in predict(self, item, return_x, batch_first, with_dropout, **kwargs)
370 def predict(self, item:ItemBase, return_x:bool=False, batch_first:bool=True, with_dropout:bool=False, **kwargs):
371 "Return predicted class, label and probabilities for `item`."
--> 372 batch = self.data.one_item(item)
373 res = self.pred_batch(batch=batch, with_dropout=with_dropout)
374 raw_pred,x = grab_idx(res,0,batch_first=batch_first),batch[0]
/opt/conda/lib/python3.6/site-packages/fastai/basic_data.py in one_item(self, item, detach, denorm, cpu)
180 ds = self.single_ds
181 with ds.set_item(item):
--> 182 return self.one_batch(ds_type=DatasetType.Single, detach=detach, denorm=denorm, cpu=cpu)
183
184 def show_batch(self, rows:int=5, ds_type:DatasetType=DatasetType.Train, reverse:bool=False, **kwargs)->None:
/opt/conda/lib/python3.6/site-packages/fastai/basic_data.py in one_batch(self, ds_type, detach, denorm, cpu)
167 w = dl.num_workers
168 dl.num_workers = 0
--> 169 try: x,y = next(iter(dl))
170 finally: dl.num_workers = w
171 if detach: x,y = to_detach(x,cpu=cpu),to_detach(y,cpu=cpu)
/opt/conda/lib/python3.6/site-packages/fastai/basic_data.py in __iter__(self)
73 def __iter__(self):
74 "Process and returns items from `DataLoader`."
---> 75 for b in self.dl: yield self.proc_batch(b)
76
77 @classmethod
/opt/conda/lib/python3.6/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/lib/python3.6/site-packages/torch/utils/data/dataloader.py in _next_data(self)
383 def _next_data(self):
384 index = self._next_index() # may raise StopIteration
--> 385 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
386 if self._pin_memory:
387 data = _utils.pin_memory.pin_memory(data)
/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]
/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]
/opt/conda/lib/python3.6/site-packages/fastai/data_block.py in __getitem__(self, idxs)
655 else: x,y = self.item ,0
656 if self.tfms or self.tfmargs:
--> 657 x = x.apply_tfms(self.tfms, **self.tfmargs)
658 if hasattr(self, 'tfms_y') and self.tfm_y and self.item is None:
659 y = y.apply_tfms(self.tfms_y, **{**self.tfmargs_y, 'do_resolve':False})
TypeError: apply_tfms() got an unexpected keyword argument 'size'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment