Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no matching function for call to ‘at::Tensor::reshape(std::vector<long long int>&) #1

Open
YuehChuan opened this issue Jan 14, 2021 · 1 comment

Comments

@YuehChuan
Copy link

H i am using
CUDA 10.1
cudnn 7.6.5
ubuntu18.04.5
Cmake 3.10

torch 1.4.0

compile getting this error

It point out
vim /home/corleone/torch-serving/src/tensor_io.cpp
row238 has something wrong

thanks

[ 25%] Built target spdlog
Scanning dependencies of target torchserving
[ 37%] Building CXX object src/CMakeFiles/torchserving.dir/tensor_io.cpp.o
/home/corleone/torch-serving/src/tensor_io.cpp: In function ‘at::Tensor torch_serving::ParseJsonTensor(const json&)’:
/home/corleone/torch-serving/src/tensor_io.cpp:236:123: error: no matching function for call to ‘at::Tensor::reshape(std::vector<long long int>&)’
   return torch::tensor(flattened_tensor, torch::TensorOptions().dtype(StringToScalarType(data_type))).reshape(tensor_shape);
                                                                                                                           ^
In file included from /home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:12:0,
                 from /home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
                 from /home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/torch/script.h:3,
                 from /home/corleone/torch-serving/src/../include/torch_serving/tensor_io.h:9,
                 from /home/corleone/torch-serving/src/tensor_io.cpp:6:
/home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/ATen/core/TensorMethods.h:2206:15: note: candidate: at::Tensor at::Tensor::reshape(c10::IntArrayRef) const
 inline Tensor Tensor::reshape(IntArrayRef shape) const {
               ^~~~~~
/home/corleone/torch-serving/venv/lib/python3.6/site-packages/torch/include/ATen/core/TensorMethods.h:2206:15: note:   no known conversion for argument 1 from ‘std::vector<long long int>’ to ‘c10::IntArrayRef {aka c10::ArrayRef<long int>}’
src/CMakeFiles/torchserving.dir/build.make:62: recipe for target 'src/CMakeFiles/torchserving.dir/tensor_io.cpp.o' failed
make[2]: *** [src/CMakeFiles/torchserving.dir/tensor_io.cpp.o] Error 1
CMakeFiles/Makefile2:981: recipe for target 'src/CMakeFiles/torchserving.dir/all' failed
make[1]: *** [src/CMakeFiles/torchserving.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

@YuehChuan
Copy link
Author

Uploading Screenshot from 2021-01-14 15-46-31.png…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant