walkwithfastai / walkwithfastai.github.io

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

1.8 pytorch problem in 06_Object_Detection #36

Closed MarkB2 closed 3 years ago

MarkB2 commented 3 years ago

Executing dls = pascal.dataloaders(path/'train') results in Could not do one pass in your dataloader, there is something wrong in it

Summary gets

/usr/local/lib/python3.7/dist-packages/fastai/vision/data.py in clip_remove_empty(bbox, label) 33 bbox = torch.clamp(bbox, -1, 1) 34 empty = ((bbox[...,2] - bbox[...,0])*(bbox[...,3] - bbox[...,1]) <= 0.) ---> 35 return (bbox[~empty], label[~empty]) 36 37 # Cell

TypeError: no implementation found for 'torch.Tensor.getitem' on types that implement __torch_function__: [TensorMultiCategory, TensorBBox]

muellerzr commented 3 years ago

Solution is to add contiguous casting to tensor bounding box, however the question then becomes this is really a fastai issue (and why didn't tests catch this)