Skip to content

Instantly share code, notes, and snippets.

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]
# Colab
```text
=== Software ===
python : 3.6.9
fastai : 1.0.61.dev0
fastprogress : 0.2.2
torch : 1.4.0
nvidia driver : 418.67
torch cuda : 10.1 / is available
torch cudnn : 7603 / is enabled
sys.platform: linux
Python: 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0]
CUDA available: True
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.0, V10.0.130
GPU 0: Tesla T4
GCC: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
PyTorch: 1.4.0
PyTorch compiling details: PyTorch built with:
- GCC 7.3
# fp16 settings
fp16 = dict(loss_scale=512.)
# model settings
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
TypeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py in fit(epochs, learn, callbacks, metrics)
107 else: val_loss=None
--> 108 if cb_handler.on_epoch_end(val_loss): break
109 except Exception as e:
17 frames
/usr/local/lib/python3.6/dist-packages/fastai/callback.py in on_epoch_end(self, val_loss)