pytorch / pytorch/vision

AttributeError: module 'torch.library' has no attribute 'register_fake'

Open
#9,020 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

I am using pytorch2.4.0, torchvision version is 0.19.0, python3.10, and an error occurs when running import torchvision

Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import torchvision
Traceback (most recent call last):
File "", line 1, in
File "/home/user/.local/lib/python3.10/site-packages/torchvision/init.py", line 10, in
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils # usort:skip
File "/home/user/.local/lib/python3.10/site-packages/torchvision/_meta_registrations.py", line 163, in
@torch.library.register_fake("torchvision::nms")
AttributeError: module 'torch.library' has no attribute 'register_fake'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the import failure with PyTorch 2.4.0 and torchvision 0.19.0 using the traceback entry point in torchvision/_meta_registrations.py at the register_fake decorator. Check the package's compatibility expectations and existing issue context; done means importing torchvision succeeds for the reported environment or the incompatibility is clearly documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.