ashkamath / mdetr

Apache License 2.0
969 stars 125 forks source link

what missing here? #13

Closed johnfelipe closed 3 years ago

johnfelipe commented 3 years ago
Traceback (most recent call last):
  File "gradio/demo.py", line 107, in <module>
    model, postprocessor = torch.hub.load('ashkamath/mdetr:main', 'mdetr_efficientnetB5', pretrained=True, return_postprocessor=True)
  File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 364, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 390, in _load_local
    hub_module = import_module(MODULE_HUBCONF, hubconf_path)
  File "/usr/local/lib/python3.8/dist-packages/torch/hub.py", line 75, in import_module
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.cache/torch/hub/ashkamath_mdetr_main/hubconf.py", line 4, in <module>
    from models.backbone import Backbone, Joiner, TimmBackbone
  File "/root/.cache/torch/hub/ashkamath_mdetr_main/models/__init__.py", line 3, in <module>
    from .mdetr import build
  File "/root/.cache/torch/hub/ashkamath_mdetr_main/models/mdetr.py", line 16, in <module>
    from util.misc import NestedTensor, interpolate
  File "/root/.cache/torch/hub/ashkamath_mdetr_main/util/misc.py", line 18, in <module>
    from torchvision.ops import _new_empty_tensor
ImportError: cannot import name '_new_empty_tensor' from 'torchvision.ops' (/usr/local/lib/python3.8/dist-packages/torchvision/ops/__init__.py)
toku-n commented 3 years ago

@johnfelipe Please check #12 and #15. I hope it helps you.

alcinos commented 3 years ago

Hi @johnfelipe

Thanks for flagging. I have pushed a fix, let me know if that works for you.