torch2trt icon indicating copy to clipboard operation
torch2trt copied to clipboard

python setup.py install --plugins compile error

Open kvrooman opened this issue 4 years ago • 7 comments

Receiving a compile error when attempting python setup.py install --plugins Will track down and add further detail but wanted to add the issue here.

C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(186): error C2440: 'initializing': cannot convert from 'std::vector<int64_t,std::allocator<int64_t>>' to 'std::vector<long,std::allocator<long>>'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(186): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(187): error C2440: 'initializing': cannot convert from 'std::vector<int64_t,std::allocator<int64_t>>' to 'std::vector<long,std::allocator<long>>'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(187): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(192): error C2665: 'at::from_blob': none of the 4 overloads could convert all the argument types
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12875): note: could be 'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12864): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12849): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &,const c10::optional<c10::Device>)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(192): note: while trying to match the argument list '(void *, std::vector<long,std::allocator<long>>, torch2trt::InterpolatePlugin::enqueue::<lambda_15b736a487956b9b8f4461045c0aad3d>, c10::TensorOptions)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(193): error C2665: 'at::from_blob': none of the 4 overloads could convert all the argument types
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12875): note: could be 'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12864): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12849): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &,const c10::optional<c10::Device>)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\interpolate.cpp(193): note: while trying to match the argument list '(void *const , std::vector<long,std::allocator<long>>, torch2trt::InterpolatePlugin::enqueue::<lambda_57b36dd04f7dec1fcf876bf3a51ed167>, c10::TensorOptions)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(52): error C2440: '=': cannot convert from 'std::vector<int64_t,std::allocator<int64_t>>' to 'int64_t'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(52): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(72): error C2039: 'toDoubleListRef': is not a member of 'c10::IValue'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\torch/csrc/jit/runtime/interpreter.h(20): note: see declaration of 'c10::IValue'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(198): error C2440: 'initializing': cannot convert from 'std::vector<int64_t,std::allocator<int64_t>>' to 'std::vector<long,std::allocator<long>>'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(198): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(199): error C2440: 'initializing': cannot convert from 'std::vector<int64_t,std::allocator<int64_t>>' to 'std::vector<long,std::allocator<long>>'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(199): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(204): error C2665: 'at::from_blob': none of the 4 overloads could convert all the argument types
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12875): note: could be 'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12864): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12849): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &,const c10::optional<c10::Device>)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(204): note: while trying to match the argument list '(void *, std::vector<long,std::allocator<long>>, torch2trt::GroupNormPlugin::enqueue::<lambda_ee5ead9536ae1e442327d6e1ec46f66b>, c10::TensorOptions)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(205): error C2665: 'at::from_blob': none of the 4 overloads could convert all the argument types
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12875): note: could be 'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12864): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &)'
C:\Users\vroom\anaconda3\lib\site-packages\torch\include\ATen/Functions.h(12849): note: or       'at::Tensor at::from_blob(void *,c10::IntArrayRef,c10::IntArrayRef,const std::function<void (void *)> &,const c10::TensorOptions &,const c10::optional<c10::Device>)'
C:\Users\vroom\Documents\Bitbucket\torch2trt\torch2trt\plugins\group_norm.cpp(205): note: while trying to match the argument list '(void *const , std::vector<long,std::allocator<long>>, torch2trt::GroupNormPlugin::enqueue::<lambda_866a9062537019c7cd459f9cd060247d>, c10::TensorOptions)'

kvrooman avatar Oct 21 '21 15:10 kvrooman

+1

vascokk avatar Oct 22 '21 22:10 vascokk

+1

VERMANs avatar Dec 06 '21 16:12 VERMANs

Did you find a solution?

andrearosasco avatar Jan 26 '22 16:01 andrearosasco

Have you found the solution for this yet? I tried following this issue https://github.com/NVIDIA-AI-IOT/torch2trt/issues/409, but got into this.

ODN81HC avatar Apr 12 '22 13:04 ODN81HC

I just switched to using tensorrt directly

andrearosasco avatar Apr 28 '22 08:04 andrearosasco

@kvrooman i also encounter this problem, please tell me how to deal with it, save my life!

jcyhcs avatar Jun 23 '22 06:06 jcyhcs

You can use tensorrt instead of torch2trt. You just have the additional step of having to export your model in onnx but that's just one function call if you use tracing

andrearosasco avatar Jun 23 '22 09:06 andrearosasco