caffe2_cpp_tutorial
caffe2_cpp_tutorial copied to clipboard
Compile error
Thank you for this caffe2 cpp tutorial.
I encountered following error when compiling this code (make).
/home/user/Desktop/caffe2_cpp_tutorial/src/caffe2/util/blob.cc: In member function ‘caffe2::TensorCPU caffe2::BlobUtil::Get()’:
/home/user/Desktop/caffe2_cpp_tutorial/src/caffe2/util/blob.cc:16:31: error: use of deleted function ‘caffe2::Tensor<Context>::Tensor(const caffe2::Tensor<Context>&) [with Context = caffe2::CPUContext]’
return blob_.Get<TensorCPU>();
^
In file included from /home/user/Desktop/caffe2_cpp_tutorial/include/caffe2/util/blob.h:5:0,
from /home/user/Desktop/caffe2_cpp_tutorial/src/caffe2/util/blob.cc:1:
/usr/local/include/caffe2/core/tensor.h:706:3: note: declared here
Tensor(const Tensor<Context>& src) = delete;
My environment is
- Ubuntu : 16.04
- g++ : 5.4
- Caffe2 : newest version from https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile
Do you have any idea to solve this problem?
Same problem here, any hints?
use GetMutable or blob_.Get<TensorCPU>().Clone()