Can't build windows torchVsion C++ API library
See original GitHub issue🐛 Describe the bug
- I try to use TorchVision c++ API in windows10. I follow https://github.com/pytorch/vision Using the models on C++. I download libtorch1.10.1-cu102 and unzip it at D:\thirdpartyforwindows_for_ai\libtorch\libtorch1.10.1-cu102.
git clone https://github.com/pytorch/vision.git
cd vision
git checkout v0.11.2
mkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH="D:\thirdpartyforwindows_for_ai\libtorch\libtorch1.10.1-cu102;C:\Users\user\Desktop\pybind11\install;C:\Users\user\anaconda3\envs\webv2\libs" -DCMAKE_INSTALL_PREFIX="C:\Users\user\Desktop\torchVision\install" DCMAKE_BUILD_TYPE=Release ..
cmake --build .
- After Build, I get some error message
D:\thirdpartyforwindows_for_ai\libtorch\libtorch1.10.1-cu102\include\ATen/core/boxing/KernelFunction_impl.h(75): error
C2672: 'c10::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch1.10.1-cu102\include\ATen/core/boxing/KernelFunction_impl.h(81): error
C2783: 'Return c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return'
推算 樣板 引數 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
- Is my Libtorch version wrong? Is there anything wrong with my build steps?
Versions
- Torch 1.10.1+cu102
- Torchvision checkout v0.11.2
- windows10
cc @peterjc123 @nbcsm @guyang3532 @maxluk @gunandrose4u @mszhanyi
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Building Torchvision C++ API from source - PyTorch Forums
I have been trying to build torchvision from source (master) on Windows 10. I cannot get past the cmake step. I see there...
Read more >Can't install pytorch with pip on Windows - Stack Overflow
The most likely reason for Your issue is a 32-bit installation of python, while the torch libraries rely on having a 64-bit version....
Read more >Installation — MMDetection 2.2.1 documentation
conda install pytorch torchvision -c pytorch. Note: Make sure that your compilation CUDA version and runtime CUDA version match. You can check the...
Read more >Install PyTorch on Jetson Nano - Q-engineering
This page will guide you through the installation of PyTorch, TorchVision, LibTorch and Caffe2 on a Jetson Nano. PyTorch is a software library...
Read more >How to set up OpenCV, LibTorch, and Torchvision with Cmake ...
First download the repo from “https://github.com/pytorch/vision” and place it somewhere convenient where you want to keep your cmake libraries.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@marcobevih2o For your reference, now I can create the dll in the following way. It still requires python. I changed Visual Studio to 2019 and Torchvision branch is nightly.
Seems that that’s a known issue before https://github.com/pytorch/vision/issues/2692#issuecomment-1009783544 .