question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
kalyanvasudevcommented, 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.

0reactions
kalyanvasudevcommented, Jun 27, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found