-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add option to build the library using the python's torch installation #3004
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
base: main
Are you sure you want to change the base?
Conversation
Hi @bmanga! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
@bmanga thanks for the PR ! Yes, this can simplify the setup, however I'm not sure the following
In my opinion, if the use-case requires torchvision C++ frontend, it is unlikely to have pytorch installed as python library... probably due to limited resources like on embedded systems. What do you think ? |
The code added is just for building the library, it's not added to the Config file and so not (yet) exposed to the users of the library. But this PR is mostly for development purposes. I would think that the most likely scenario where the c++ torchvision lib is used is to add the ops required to run torchscript models. And these models are probably created using the python frontend, which means that Of course, all of this is completely optional :) |
Hi @bmanga Thanks for the PR! Just chiming in to bring a few extra points:
With #2897 (and after we refactor a few things), torchvision will be able to run on android devices. Additionally, in #3011 I mention that it would be great to remove all Python includes from the torchvision C++ dependency, but for now for some reason Windows requires it, but we should find a way of fixing this. |
Hi @fmassa :)
I would say that falls under the second part of my argument: You won't build torchvision on android, just deploy there.
I would love to see that 😁, but this PR doesn't introduce a dependency of the binary on python. It's just a build dependency. I am not strongly pushing for this, I just think it's a nice convenience over using
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
1 similar comment
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
This adds an option to use python's torch installation, which is usually easier to obtain (and very likely to be available).
I'm undecided as to whether we should be adding this logic also to the Config file (so users can also use the option when using the library), but that can be added later.