Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'slow_r50_detection' from 'pytorchvideo.models.hub #70

Closed
TianhaoFu opened this issue Jun 22, 2021 · 8 comments
Assignees
Labels
bug Something isn't working unexpected behaviour

Comments

@TianhaoFu
Copy link

馃悰 Bugs / Unexpected behaviors

when using

model_name = "slowfast_r50"
SLOWFAST50_MODEL = torch.hub.load("facebookresearch/pytorchvideo", model=model_name, pretrained=True)

I came across bug follows

/root/.cache/torch/hub/facebookresearch_pytorchvideo_master/hubconf.py in <module>()
      2 
      3 dependencies = ["torch"]
----> 4 from pytorchvideo.models.hub import (  # noqa: F401, E402
      5     efficient_x3d_s,
      6     efficient_x3d_xs,
ImportError: cannot import name 'slow_r50_detection' from 'pytorchvideo.models.hub' (/usr/local/lib/python3.7/dist-packages/pytorchvideo/models/hub/__init__.py)

Instructions To Reproduce the Issue:

  1. My code came from https://pytorchvideo.org/docs/tutorial_torchhub_inference.

  2. My environment is google colab.


It Seems is a bug from official respository. Thanks

@Meryl-Fang
Copy link

Second it, just met the same problem! (For now I just comment out the models that raise error :/ )

@kalyanvasudev
Copy link
Contributor

@TianhaoFu , @Meryl-Fang , could please provide more details on how you installed pytorchvideo and your testing environment?

When I ran the following notebook in Colab, I did not have issues - https://colab.research.google.com/github/facebookresearch/pytorchvideo/blob/master/tutorials/torchhub_inference_tutorial.ipynb

@Kupchanski
Copy link

Kupchanski commented Jun 22, 2021

Same.
I just copy code from https://pytorchvideo.org/docs/tutorial_torchhub_inference cell by cell to google coolab and got this error on model import from torch.hub
Install lib in first cell !pip install pytorchvideo

@kalyanvasudev
Copy link
Contributor

kalyanvasudev commented Jun 22, 2021

Got it, I was able to pinpoint it down. Looks like the pip build is out of date. I will update it today.

Alternatively, reinstalling Pytorchvideo using !pip install "git+https://github.com/facebookresearch/pytorchvideo.git" should fix the problem.

@kaitsmith22
Copy link

Even though I reinstalled Pytorchvideo using pip install "git+https://github.com/facebookresearch/pytorchvideo.git" I am still encountering the same problem. My environment is a Jupytr notebook.

@taliegemen
Copy link

taliegemen commented Jun 25, 2021

The error still persists on my local machine even if i install pytorchvideo from git. There is no problem on google colab though.

@kalyanvasudev
Copy link
Contributor

Hi, I've updated the pip builds too to match the latest commits. All the installation methods mentioned here should work now. I just verified it.

Please let me know if the issue persists!

@kalyanvasudev kalyanvasudev added the bug Something isn't working label Jun 27, 2021
@kalyanvasudev
Copy link
Contributor

Closing the issue since it has been resolved. But feel free to open it again if the problem still persists for you.

For all of you who installed version 0.1.1, I'd recommend uninstalling it and installing 0.1.2 or higher. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unexpected behaviour
Projects
None yet
Development

No branches or pull requests

6 participants