torch2trt
torch2trt copied to clipboard
python setup.py install --plugins compile error
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)'
+1
+1
Did you find a solution?
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.
I just switched to using tensorrt directly
@kvrooman i also encounter this problem, please tell me how to deal with it, save my life!
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