ImportError: cannot import name 'slow_r50_detection' from 'pytorchvideo.models.hub
See original GitHub issue🐛 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:
-
My code came from https://pytorchvideo.org/docs/tutorial_torchhub_inference.
-
My environment is google colab.
It Seems is a bug from official respository. Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to resolve the hugging face error ImportError: cannot ...
Using google colab I could easily run the models openai/clip-vit-base-patch32 from PIL import Image import requests from transformers import ...
Read more >_model_URL import error - vision - PyTorch Forums
ImportError : cannot import name '_MODEL_URLS' from 'torchvision.models.mnasnet'. I am getting import error while import this:
Read more >Build your efficient model with PytorchVideo/Accelerator
First, let's import efficient blocks. # Imports import torch.nn as nn from pytorchvideo.layers.accelerator.mobile_cpu.activation_functions import ...
Read more >cannot import name 'mobilenet_v2' from 'torchvision.models ...
ImportError : cannot import name 'mobilenet_v2' from 'torchvision.models' (C:\file_path\__init__.py). The Code I tried to execute:.
Read more >SlowFast - a Hugging Face Space by pytorch
Reason: Error, exitCode: 1, message: None ... line 3, in <module> model = torch.hub.load('facebookresearch/pytorchvideo', 'slowfast_r50', pretrained=True) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.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!