Skip to content

Can't build windows torchVsion C++ API library #5277

Open
@billy800413

Description

@billy800413

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions