pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.06k stars 6.93k forks source link

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

Open billy800413 opened 2 years ago

billy800413 commented 2 years ago

🐛 Describe the bug

cc @peterjc123 @nbcsm @guyang3532 @maxluk @gunandrose4u @mszhanyi

datumbox commented 2 years ago

@billy800413 The latest version of TorchVision requires the nightly of libtorch not v1.10. Download the right version by going to PyTorch.org and selecting LibTorch + Windows + Cuda version.

billy800413 commented 2 years ago

@datumbox Thanks for your reply. But I still get the error using the following combination

Is there any documentation for version combination? (c++ Libtorch, TorchVision in windows) and example?

log1

C:\Users\user\Desktop\torchVision\build>cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH="D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126;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 ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: C:/Users/user/anaconda3/libs/python38.lib (found version "3.8.8") found components: Development Development.Module Development.Embed
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2 (found version "10.2")
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe
-- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2
-- Caffe2: Header version is: 10.2
-- Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/cudnn.lib
-- Found cuDNN: v7.6.4  (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/cudnn.lib)
-- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/nvrtc.lib shorthash is 76e0edf4
-- Autodetected CUDA architecture(s):  7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found Torch: D:/thirdpartyforwindows_for_ai/libtorch/libtorch-win-shared-with-deps-latest20220126/lib/torch.lib
-- Found ZLIB: C:/Users/user/anaconda3/envs/webv2/Library/lib/z.lib (found version "1.2.11")
-- Found PNG: C:/ProgramData/Anaconda3/Library/lib/libpng.lib (found version "1.6.37")
-- Found JPEG: C:/Users/user/anaconda3/envs/webv2/Library/lib/jpeg.lib (found version "80")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/user/Desktop/torchVision/build

log2

(webv2) C:\Users\user\Desktop\torchVision\build>cmake --build . --config Release
Microsoft (R) Build Engine for .NET Framework 15.9.21+g9802d43bc3 版
Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。

  Checking Build System
  Building Custom Rule C:/Users/user/Desktop/torchVision/CMakeLists.txt
cl : 命令列 warning D9025: 覆寫 '/W3',以 '/w' [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  common_jpeg.cpp
  decode_image.cpp
  decode_jpeg.cpp
  decode_png.cpp
  encode_jpeg.cpp
  encode_png.cpp
  read_write_file.cpp
  decode_jpeg_cuda.cpp
  image.cpp
  alexnet.cpp
  densenet.cpp
  googlenet.cpp
  inception.cpp
  mnasnet.cpp
  mobilenet.cpp
  resnet.cpp
  shufflenetv2.cpp
  squeezenet.cpp
  vgg.cpp
  interpolate_aa_kernels.cpp
  正在產生程式碼...
  正在編譯...
  nms_kernel.cpp
  deform_conv2d.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at
  ::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 參考
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor
  &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool>(const c10::OperatorHandle &,c10::DispatchKeySet,const at::Tensor &,const at::Te
  nsor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool
  ) const' 之參考
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor&,const at::Tensor&,in
  t64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool>(const c10::TypedOperatorHandle<std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tens
  or,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64
  _t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)> &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,cons
  t at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool) const' 之參考
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Te
  nsor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>::call(const at::
  Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t
  ,int64_t,int64_t,bool) const' 時
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\deform_conv2d.cpp(66): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<std::tuple<at::T
  ensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,cons
  t at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>::call(const at::Tensor &,const at::Tensor &,const at::Tensor &,co
  nst at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool) const' 之參考
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\deform_conv2d.cpp(65): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<std::tuple<at::Tensor,at
  ::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Te
  nsor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const
   at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::T
ensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,in
  t64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的宣告
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t
  ,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int
64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64
  _t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
  interpolate_aa.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,c10::IntArrayRef,c10::IntArrayRef,bool>(const c10::OperatorHandle &,c10::DispatchKeySet,
  const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,c10::IntArrayRef,c10::IntArrayRef,bool>(const c10::TypedOperatorHandle<at::Tensor (const at:
  :Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool)> &,const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool)>::call(const at::Tensor &,c10::IntArrayRef,c10:
  :IntArrayRef,bool) const' 時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\interpolate_aa.cpp(44): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (con
  st at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool)>::call(const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\interpolate_aa.cpp(43): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::T
  ensor &,c10::IntArrayRef,c10::IntArrayRef,bool)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool),void>' 的成員 [C:\Users\user\Desktop\torchVision\b
uild\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,c10::IntArrayRef,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,bool),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.
vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,bool),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
  nms.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,double>(const c10::OperatorHandle &,c10::DispatchKeySet,const at::Tens
  or &,const at::Tensor &,double) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,double>(const c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,cons
  t at::Tensor &,double)> &,const at::Tensor &,const at::Tensor &,double) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,double)>::call(const at::Tensor &,const at::Tensor &,double) const'
  時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\nms.cpp(15): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (const at::Tens
  or &,const at::Tensor &,double)>::call(const at::Tensor &,const at::Tensor &,double) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\nms.cpp(14): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,con
  st at::Tensor &,double)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,double)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvis
ion.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
  ps_roi_align.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t
  ,int64_t,int64_t),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64
  _t,int64_t>(const c10::OperatorHandle &,c10::DispatchKeySet,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int
  64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,i
  nt64_t>(const c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int6
  4_t,int64_t,int64_t)> &,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const'
   之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
  t64_t,int64_t)>::call(const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\ps_roi_align.cpp(40): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (const
   at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>::call(const at::Tensor &,const at:
  :Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\ps_roi_align.cpp(39): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::Ten
  sor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_
  t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
t64_t,int64_t),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int6
  4_t),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=std::tuple<at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t),void>' 的成員 [C:\Users\user\Desktop\to
rchVision\build\torchvision.vcxproj]
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t),void>' 的宣告
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  ps_roi_pool.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t
  ,int64_t),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64
  _t>(const c10::OperatorHandle &,c10::DispatchKeySet,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int
  64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t>(
  const c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int6
  4_t)> &,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
  t64_t)>::call(const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\ps_roi_pool.cpp(37): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (const
  at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>::call(const at::Tensor &,const at::Tensor &
  ,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\ps_roi_pool.cpp(36): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::Tens
  or &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
t64_t),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t),voi
  d>' 的宣告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=std::tuple<at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t),void>' 的成員 [C:\Users\user\Desktop\torchVisio
n\build\torchvision.vcxproj]
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t),void>' 的宣告
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  roi_align.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bo
  ol),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool>(c
  onst c10::OperatorHandle &,c10::DispatchKeySet,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,boo
  l) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool>(const
   c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)> &,con
  st at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
  >::call(const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool) const' 時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\roi_align.cpp(50): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (const at
  ::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>::call(const at::Tensor &,const at::Tensor &,double,
  int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\roi_align.cpp(49): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::Tensor
   &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
,void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的 宣
  告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,bool)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,bool),void>' 的成員 [C:\Users\user\Deskt
op\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,bool),void>' 的宣告
          with
          [
              Return=at::Tensor
          ]
  roi_pool.cpp
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2066: 轉換成函式 類型不合法
 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 查看要編 譯的 類
  別 樣板 具現化 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t
  ,int64_t),void>' 參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(543): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::KernelFunction::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64
  _t>(const c10::OperatorHandle &,c10::DispatchKeySet,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int
  64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(409): note: 請參閱所要編譯 的函式 樣板
  具現化 'Return c10::Dispatcher::call<Return,const at::Tensor&,const at::Tensor&,const at::Tensor&,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t>(
  const c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int6
  4_t)> &,const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/dispatch/Dispatcher.h(408): note: 編譯 類別 樣板 成員函式
  'Return c10::TypedOperatorHandle<at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
  t64_t)>::call(const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 時
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\roi_pool.cpp(36): note: 請參閱所要編譯的函式 樣板 具現化 'Return c10::TypedOperatorHandle<at::Tensor (const at:
  :Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>::call(const at::Tensor &,const at::Tensor &,co
  nst at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t) const' 之參考
          with
          [
              Return=at::Tensor
          ]
  C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\roi_pool.cpp(35): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<at::Tensor (const at::Tensor
  &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/ivalue_inl.h(1406): note: 查看要編譯的 類別 樣板 具現化 'c10:
  :ArrayRef<T>' 參考
          with
          [
              T=c10::IValue
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/MemoryFormat.h(63): note: 查看要編譯的 類別 樣板  具現化 'c10::
  ArrayRef<int64_t>' 參考
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\c10/core/DispatchKeySet.h(57): note: 查看要編譯的 類別 樣板 具現化 'std
  ::initializer_list<c10::DispatchKey>' 參考
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function s
ignature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelW
rapper<(your function type), void>'" - (your function type) is the unsupported signature. [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,in
t64_t),void>' 的成員 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              Return=at::Tensor
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,double,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t),voi
  d>' 的宣告
          with
          [
              Return=at::Tensor
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c1
0::KernelFunction::call': 找不到相符的多載函式 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(81): error C2783: 'Re
turn c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': 無法針對 'Return' 推算 樣板 引數 [C:\Users\user\Desktop\torchVision
\build\torchvision.vcxproj]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::Ke
  rnelFunction::call' 的宣告
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType'
: sizeof 運算元不合法,必須是運算式或類型名稱 [C:\Users\user\Desktop\torchVision\build\torchvision.vcxproj]
          with
          [
              FuncType=std::tuple<at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t)
          ]
D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'ca
ll': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t),void>' 的成員 [C:\Users\user\Desktop\torchVisio
n\build\torchvision.vcxproj]
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  D:\thirdpartyforwindows_for_ai\libtorch\libtorch-win-shared-with-deps-latest20220126\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10
  ::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,double,int64_t,int64_t),void>' 的宣告
          with
          [
              Return=std::tuple<at::Tensor,at::Tensor>
          ]
  vision.cpp
  正在產生程式碼...
datumbox commented 2 years ago

TorchVision checkout v0.11.2

Sorry I missed you were checking out v0.11.2 and not working on the latest main branch. For that, the right TorchLib version is 1.10.1 (https://download.pytorch.org/libtorch/cu102/libtorch-win-shared-with-deps-1.10.1%2Bcu102.zip)

Afterwards to build TorchVision, do (details here): python setup.py develop

Building directly with cmake is not currently supported, see #2349

billy800413 commented 2 years ago

@datumbox Thanks for your reply. But I still get some errors. At first, it seems to find "...HostX86\x64\cl.exe" successfully(log1). But after a while, it shows log2 error. I also find some errors like.

C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'call': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的成員

Do I need to update Microsoft Visual Studio?

My env

Microsoft Visual Studio2017, VC++ tools version 14.16.27023

Visual Studio Locator version 2.7.1+180c706d56 [query version 2.11.47.9733]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 6c7aaf57
installDate: 2021/8/18 下午 12:27:09
installationName: VisualStudio/15.9.43+28307.1778
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
installationVersion: 15.9.28307.1778
productId: Microsoft.VisualStudio.Product.Community
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
state: 4294967295
isComplete: 1
isLaunchable: 1
isPrerelease: 0
isRebootRequired: 0
displayName: Visual Studio Community 2017
description: 功能齊備的 IDE,可供學生、開放原始碼開發人員與個人開發人員免費使用
channelId: VisualStudio.15.Release
channelUri: https://aka.ms/vs/15/release/channel
enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
releaseNotes: https://go.microsoft.com/fwlink/?LinkId=660692#15.9.43
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660708
updateDate: 2022-01-27T08:05:03.5324312Z
catalog_buildBranch: d15.9
catalog_buildVersion: 15.9.28307.1778
catalog_id: VisualStudio/15.9.43+28307.1778
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 15.9.43
catalog_productLine: Dev15
catalog_productLineVersion: 2017
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 43
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productRelease: RTW
catalog_productSemanticVersion: 15.9.43+28307.1778
catalog_requiredEngineVersion: 1.18.1063.29791
properties_campaignId:
properties_channelManifestId: VisualStudio.15.Release/15.9.43+28307.1778
properties_nickname:
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe

python anaconda env - name webv2

(webv2) C:\Users\user\Desktop\torchVision>pip list
Package           Version
----------------- ------------
certifi           2020.6.20
dataclasses       0.8
numpy             1.19.5
Pillow            8.4.0
pip               21.2.2
setuptools        58.0.4
torch             1.10.1+cu102
torchaudio        0.10.1+cu102
typing_extensions 4.0.1
wheel             0.37.1
wincertstore      0.2

Cuda

(webv2) C:\Users\user\Desktop\torchVision>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89

System Path

(webv2) C:\Users\user\Desktop\torchVision>echo %path%
........;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64

Build command

(base) C:\Users\user>cd Desktop\torchVision
(base) C:\Users\user\Desktop\torchVision>conda activate webv2
(webv2) C:\Users\user\Desktop\torchVision>git branch
* (HEAD detached at v0.11.2)
  main
(webv2) C:\Users\user\Desktop\torchVision>python setup.py develop

Log1

(webv2) C:\Users\user\Desktop\torchVision>python setup.py develop
Building wheel torchvision-0.11.0a0+e7ec7e2
PNG found: True
Running build on conda-build: False
Running build on conda: True
JPEG found: True
Building torchvision with JPEG image support
NVJPEG found: True
Building torchvision with NVJPEG image support
FFmpeg found: False
running develop
running egg_info
writing torchvision.egg-info\PKG-INFO
writing dependency_links to torchvision.egg-info\dependency_links.txt
writing requirements to torchvision.egg-info\requires.txt
writing top-level names to torchvision.egg-info\top_level.txt
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\utils\cpp_extension.py:381: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'torchvision.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
adding license file 'LICENSE'
writing manifest file 'torchvision.egg-info\SOURCES.txt'
running build_ext
building 'torchvision._C' extension
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -Dtorchvision_EXPORTS -IC:\Users\user\Desktop\torchVision\torchvision\csrc -IC:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include -IC:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\TH -IC:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -IC:\Users\user\anaconda3\envs\webv2\include -IC:\Users\user\anaconda3\envs\webv2\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\user\Desktop\torchVision\torchvision\csrc\ops\autocast\deform_conv2d_kernel.cpp /Fobuild\temp.win-amd64-3.6\Release\Users\user\Desktop\torchVision\torchvision\csrc\ops\autocast\deform_conv2d_kernel.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /MP -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0

Log2

C:\Users\user\Desktop\torchVision\torchvision\csrc\ops\deform_conv2d.cpp(65): note: 查看要編譯的 類別 樣板 具現化 'c10::TypedOperatorHandle<std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)>' 參考
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType': sizeof 運算元不合法,必須 是運算式或類型名稱
        with
        [
            FuncType=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor> (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
        ]
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/impl/boxing.h(152): error C2338: Function signature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelWrapper<(your function type), void>'" - (your function type) is the unsupported signature.
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'call': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的成員
        with
        [
            Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
        ]
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的宣告
        with
        [
            Return=std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor,at::Tensor>
        ]
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2672: 'c10::KernelFunction::call': 找不到相符的多載函式
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\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\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction.h(155): note: 請參閱 'c10::KernelFunction::call' 的宣告
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/impl/boxing.h(152): error C2070: 'FuncType': sizeof 運算元不合法,必須 是運算式或類型名稱
        with
        [
            FuncType=at::Tensor (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool)
        ]
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): error C2039: 'call': 不是 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的成員
        with
        [
            Return=at::Tensor
        ]
C:\Users\user\anaconda3\envs\webv2\lib\site-packages\torch\include\ATen/core/boxing/KernelFunction_impl.h(75): note: 請參閱 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,const at::Tensor &,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,bool),void>' 的宣告
        with
        [
            Return=at::Tensor
        ]
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
marcobevih2o commented 2 years ago

I'm facing the same error with same configuration:

Errors showed by VS:

C2672 'c10::KernelFunction::call': no matching overloaded function found C:\libtorch\include\ATen\core\boxing\KernelFunction_impl.h 75

C2039 'call': is not a member of 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,bool),void>' C:\libtorch\include\ATen\core\boxing\KernelFunction_impl.h 75

C2039 'call': is not a member of 'c10::impl::BoxedKernelWrapper<Return (const at::Tensor &,c10::IntArrayRef,c10::IntArrayRef,bool),void>' C:\libtorch\include\ATen\core\boxing\KernelFunction_impl.h 75

C2070 'FuncType': illegal sizeof operand C:\libtorch\include\ATen\core\boxing\impl\boxing.h 152

C2783 'Return c10::KernelFunction::call(const c10::OperatorHandle &,c10::DispatchKeySet,Args...) const': could not deduce template argument for 'Return' C:\libtorch\include\ATen\core\boxing\KernelFunction_impl.h 81

C2066 cast to function type is illegal C:\libtorch\include\ATen\core\boxing\impl\boxing.h 152

C2338 Function signature contains one or more unsupported parameter and/or return types. Look for a nearby error like "'call' is not a member of 'c10::impl::BoxedKernelWrapper<(your function type), void>'" - (your function type) is the unsupported signature. C:\libtorch\include\ATen\core\boxing\impl\boxing.h 152

malfet commented 2 years ago

@marcobevih2o PyTorch is not compatible with VS2017, as this compiler have a lots of known bugs in C++14 standard implementation. Please update to VS2019 or later

billy800413 commented 2 years ago

@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.

git clone https://github.com/pytorch/vision.git
cd vision
git checkout nightly
Download https://download.pytorch.org/libtorch/nightly/cu102/libtorch-win-shared-with-deps-latest.zip
conda create --name test python=3.6
conda activate test
conda install -c conda-forge libjpeg-turbo
conda install -c anaconda libpng
conda install -c anaconda zlib
mkdir build
cd build
SET DISTUTILS_USE_SDK=1
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
cmake -DUSE_PYTHON=OFF -DWITH_CUDA=on -DCMAKE_PREFIX_PATH="C:\Users\user\Desktop\libtorch-win-shared-with-deps-latest\libtorch"  DCMAKE_BUILD_TYPE=Release -A x64 ..
cmake --build . --config Release
zhiqwang commented 2 years ago

It still requires python.

Seems that that's a known issue before https://github.com/pytorch/vision/issues/2692#issuecomment-1009783544 .