Skip to content

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

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WangXinYi111 opened this issue Apr 16, 2025 · 1 comment

Comments

@WangXinYi111
Copy link

WangXinYi111 commented Apr 16, 2025

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'

@NicolasHug
Copy link
Member

Hi @WangXinYi111 , can you share how you installed torchvision and pytorch? Also please share the output of

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

as originally requested in our bug report form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants