ashkamath / mdetr

Apache License 2.0
969 stars 125 forks source link

Colab issue #12

Closed benjaminserranotapia closed 3 years ago

benjaminserranotapia commented 3 years ago

Hi, The colab book demo using current torchvision version (0.10.0) is not working https://colab.research.google.com/github/ashkamath/mdetr/blob/colab/notebooks/MDETR_demo.ipynb

/root/.cache/torch/hub/ashkamath_mdetr_main/util/misc.py in <module>()
     16 # needed due to empty tensor bug in pytorch and torchvision 0.5
     17 if float(torchvision.__version__[:3]) < 0.7:
---> 18     from torchvision.ops import _new_empty_tensor
     19     from torchvision.ops.misc import _output_size
     20 

ImportError: cannot import name '_new_empty_tensor' from 'torchvision.ops' (/usr/local/lib/python3.7/dist-packages/torchvision/ops/__init__.py)

I think this happens because it takes the version number like 0.1 and this number is less than 0.7 entering the loop when it shouldn't

alcinos commented 3 years ago

Hi @benjaminserranotapia

Thanks for flagging. I have pushed a fix, seems to work now. Don't hesitate to reach out if you run into further issues.