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

Already on GitHub? Sign in to your account

Update usages of torch.library APIs #8384

Merged
merged 6 commits into from
Jun 6, 2024
Merged

Update usages of torch.library APIs #8384

merged 6 commits into from
Jun 6, 2024

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Apr 18, 2024

We deprecated impl_abstract. This PR replaces it with the new API (register_fake). register_fake also (sometimes) requires a set_python_module in C++, so I add that as well.

Test Plan:

  • existing tests

Copy link

pytorch-bot bot commented Apr 18, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8384

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit 4520bd4 with merge base e1f1fbe (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

We deprecated impl_abstract. This PR replaces it with the new API
(register_fake). register_fake also (sometimes) requires a
`set_python_module` in C++, so I add that as well.

Test Plan:
- existing tests
@NicolasHug NicolasHug marked this pull request as ready for review June 6, 2024 10:11
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zou3519 !

@NicolasHug NicolasHug merged commit a471305 into main Jun 6, 2024
71 of 73 checks passed
@NicolasHug NicolasHug deleted the rzou/fix_meta branch June 6, 2024 12:43
facebook-github-bot pushed a commit that referenced this pull request Jun 7, 2024
Reviewed By: vmoens

Differential Revision: D58283859

fbshipit-source-id: e882d7dbc22ec3e04edea50f95b6a30456f8fd2b

Co-authored-by: Nicolas Hug <[email protected]>
Co-authored-by: Nicolas Hug <[email protected]>
huydhn added a commit to huydhn/vision that referenced this pull request Jun 9, 2024
huydhn added a commit to huydhn/vision that referenced this pull request Jun 9, 2024
@zbt78
Copy link

zbt78 commented Jun 27, 2024

hello,when i install vision by source code,i got this error:

/home/gai_test/wuyang/vision/torchvision/csrc/ops/nms.cpp:22:5: error: ‘class torch::Library’ has no member named ‘set_python_module’
   22 |   m.set_python_module("torchvision._meta_registrations");
      |     ^~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

is there any solutions?
thank you!

@jielyu
Copy link

jielyu commented Jul 5, 2024

hello,when i install vision by source code,i got this error:

/home/gai_test/wuyang/vision/torchvision/csrc/ops/nms.cpp:22:5: error: ‘class torch::Library’ has no member named ‘set_python_module’
   22 |   m.set_python_module("torchvision._meta_registrations");
      |     ^~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

is there any solutions? thank you!

It seems like the versions are not matching. You can check the corresponding versions of Torch and TorchVision on the official website, and then switch TorchVision’s source code to the appropriate version.
INSTALLING PREVIOUS VERSIONS OF PYTORCH

@humphreyde
Copy link

hello,when i install vision by source code,i got this error:

/home/gai_test/wuyang/vision/torchvision/csrc/ops/nms.cpp:22:5: error: ‘class torch::Library’ has no member named ‘set_python_module’
   22 |   m.set_python_module("torchvision._meta_registrations");
      |     ^~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

is there any solutions? thank you!

It seems like the versions are not matching. You can check the corresponding versions of Torch and TorchVision on the official website, and then switch TorchVision’s source code to the appropriate version. INSTALLING PREVIOUS VERSIONS OF PYTORCH

I got the same problem, while I'm using torch==2.4.0 torchvision==0.19.0 on jetson(arch). They are matched.But I got error:
/vision-0.19.0/torchvision/csrc/ops/nms.cpp:22:5: error: ‘class torch::Library’ has no member named ‘set_python_module’

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

Successfully merging this pull request may close these issues.

6 participants