-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Cannot load scripted Keypoint-RCNN model in C++ #2736
Comments
Thanks for the report! Recently, faster rcnn resnet50 tracing test was added: https://github.com/pytorch/vision/tree/master/test/tracing/frcnn Could you please check if it works for you with faster rcnn like in the test and if it fails with keypoint rcnn ? cc @andfoy |
@vfdev-5 Hello! |
@lysukhin Can you try compiling the example in https://github.com/pytorch/vision/tree/master/test/tracing/frcnn (using the CMakeLists from there) and report back? Also, looks like the example had to include vision/test/tracing/frcnn/test_frcnn_tracing.cpp Lines 4 to 6 in e70c91a
|
@fmassa Sure, but I'm not able to locate |
@lysukhin I think you have to build torchvision C++ API as here : https://github.com/pytorch/vision#c-api |
@vfdev-5 @fmassa Well, I was able to build torchvision C++ API from source (after a couple of rows of re-installing But using provided code for CMakeLists.txt and so from here as you suggested (https://github.com/pytorch/vision/tree/master/test/tracing/frcnn) still results in a There might be something that I'm missing here! |
@lysukhin here is what our CI does: vision/.circleci/config.yml.in Lines 603 to 606 in a98e17e
The env setup is in this file, which basically setups conda and install the dependencies. The rest of the CI exports include paths and generates the CMake files, and then the execution is done in vision/packaging/build_cmake.sh Lines 60 to 83 in a98e17e
Please let us know what parts have been missing for you, so that we can improve our examples / tutorials on how to get this working. cc @andfoy |
@lysukhin, don't forget also to install libtorchvision via vision/packaging/build_cmake.sh Line 48 in a98e17e
|
@andfoy might be good to better document how to get Faster R-CNN to run on torchscript C++. Maybe an example or tutorial would be helpful to consider? |
We should definitely add a tutorial so that it is more easier for users to use |
@fmassa
But still I'm getting this annoying thing:
|
Any updates on this? @andfoy |
I changed this line
to #include <torchvision/ROIPool.h> can address this issue (just for |
I believe this has been fixed with #2798 which is available in torchvision from master (but not in the 0.8.1 release). Please let us know if this still doesn't work for you even if you are using torchvision from master. |
🐛 Bug
Hello!
I am trying to load a Keypoint-RCNN model into C++ via TorchScript scripting.
Scripting in python itself works ok (with no errors), however loading to C++ throws an error:
And yes, I am using nightly builds (
torch ver. 1.7.0.dev20200929
,torchvision ver. 0.8.0.dev20200929
) (as offered here: https://discuss.pytorch.org/t/torchvision-ops-nms-in-torchscript/89286/2).To Reproduce
Steps to reproduce the behavior:
CMakeLists.txt
as proposed in https://pytorch.org/tutorials/advanced/cpp_export.html:mkdir build; cd build; cmake -DCMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` ..; cmake --build . --config Release
./torchscript-example ../kpcnn.pt
Environment
conda
,pip
, source):conda
Additional context
Same behaviour is met at stable release.
Changing model to
torchvision.models.resnet50()
work just fine.The text was updated successfully, but these errors were encountered: