walkwithfastai / walkwithfastai.github.io

Host for https://walkwithfastai.com
Other
143 stars 53 forks source link

Object Detection is unable to build a dataloader #59

Open RVirmoors opened 2 years ago

RVirmoors commented 2 years ago

https://walkwithfastai.com/Object_Detection

Using the current version of fastai, attempting to show a batch produces this error:

RuntimeError: Error when trying to collate the data into batches with fa_collate, at least two tensors in the batch are not the same size.

Mismatch found on axis 1 of the batch and is of type `TensorBBox`:
    Item at index 0 has shape: torch.Size([6, 4])
    Item at index 1 has shape: torch.Size([1, 4])

Please include a transform in `after_item` that ensures all data of type TensorBBox is the same size

If I install the versions listed on the page (fastai==2.1.10 fastcore==1.3.13 wwf==0.0.8), I get an initial import error: ModuleNotFoundError: No module named 'torchvision.models.utils' ... for which there is a workaround, which then leaves me with this error for pascal.summary:

TypeError: no implementation found for 'torch.Tensor.__getitem__' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorMultiCategory'>, <class 'fastai.vision.core.TensorBBox'>]