lymhust / caffe_torch_binding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while make

PapaBeye opened this issue · comments

Can anyone help me resolve these errors?
papa@beye:~/caffe_torch_binding$ CAFFE_DIR=$CAFFE_ROOT/ luarocks make
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/papa/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/papa/torch/install/lib/luarocks/rocks/caffe/1.0-0";
make

-- Found Torch7 in /home/papa/torch/install
CAFFE_DIR: /home/papa/caffe/
-- Configuring done
-- Generating done
-- Build files have been written to: /home/papa/caffe_torch_binding/build
[ 50%] Building CXX object CMakeFiles/tcaffe.dir/caffe.cpp.o
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void init(void**, const char*, const char*, const char*)’:
/home/papa/caffe_torch_binding/caffe.cpp:52:3: error: ‘caffe::Net’ is not a template
Net* net_ = new Net(string(param_file), phase);
^
/home/papa/caffe_torch_binding/caffe.cpp:52:26: error: ‘caffe::Net’ is not a template
Net* net_ = new Net(string(param_file), phase);
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void do_forward(void**, THFloatTensor*, THFloatTensor*)’:
/home/papa/caffe_torch_binding/caffe.cpp:60:3: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:60:23: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:61:16: error: ‘caffe::Blob’ is not a template
const vector<Blob
>& input_blobs = net_->input_blobs();
^
/home/papa/caffe_torch_binding/caffe.cpp:69:44: error: no matching function for call to ‘caffe::Blob::mutable_cpu_data()’
input_blobs[i]->mutable_cpu_data());
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:338:10: note: candidate: template Dtype* caffe::Blob::mutable_cpu_data()
Dtype* mutable_cpu_data() { // Keeping PyCaffe intact
^
/home/papa/caffe/include/caffe/blob.hpp:338:10: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:69:44: note: couldn't deduce template parameter ‘Dtype’
input_blobs[i]->mutable_cpu_data());
^
/home/papa/caffe_torch_binding/caffe.cpp:73:44: error: no matching function for call to ‘caffe::Blob::mutable_gpu_data()’
input_blobs[i]->mutable_gpu_data());
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:510:10: note: candidate: template Dtype* caffe::Blob::mutable_gpu_data()
Dtype* mutable_gpu_data() { // Keeping PyCaffe intact
^
/home/papa/caffe/include/caffe/blob.hpp:510:10: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:73:44: note: couldn't deduce template parameter ‘Dtype’
input_blobs[i]->mutable_gpu_data());
^
/home/papa/caffe_torch_binding/caffe.cpp:79:16: error: ‘caffe::Blob’ is not a template
const vector<Blob>& output_blobs = net_->ForwardPrefilled();
^
/home/papa/caffe_torch_binding/caffe.cpp:79:52: error: ‘class caffe::Net’ has no member named ‘ForwardPrefilled’
const vector<Blob
>& output_blobs = net_->ForwardPrefilled();
^
/home/papa/caffe_torch_binding/caffe.cpp:87:70: error: no matching function for call to ‘caffe::Blob::cpu_data()’
caffe_copy(output_blobs[i]->count(), output_blobs[i]->cpu_data(),
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: candidate: template const Dtype* caffe::Blob::cpu_data() const
const Dtype* cpu_data() const {
^
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:87:70: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(output_blobs[i]->count(), output_blobs[i]->cpu_data(),
^
/home/papa/caffe_torch_binding/caffe.cpp:91:70: error: no matching function for call to ‘caffe::Blob::gpu_data()’
caffe_copy(output_blobs[i]->count(), output_blobs[i]->gpu_data(),
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:492:16: note: candidate: template const Dtype* caffe::Blob::gpu_data() const
const Dtype* gpu_data() const {
^
/home/papa/caffe/include/caffe/blob.hpp:492:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:91:70: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(output_blobs[i]->count(), output_blobs[i]->gpu_data(),
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void do_backward(void**, THFloatTensor*, THFloatTensor*)’:
/home/papa/caffe_torch_binding/caffe.cpp:102:3: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:102:23: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:103:16: error: ‘caffe::Blob’ is not a template
const vector<Blob
>& output_blobs = net_->output_blobs();
^
/home/papa/caffe_torch_binding/caffe.cpp:104:16: error: ‘caffe::Blob’ is not a template
const vector<Blob>& input_blobs = net_->input_blobs();
^
/home/papa/caffe_torch_binding/caffe.cpp:111:45: error: no matching function for call to ‘caffe::Blob::mutable_cpu_diff()’
output_blobs[i]->mutable_cpu_diff());
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:349:10: note: candidate: template Dtype
caffe::Blob::mutable_cpu_diff()
Dtype* mutable_cpu_diff() {
^
/home/papa/caffe/include/caffe/blob.hpp:349:10: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:111:45: note: couldn't deduce template parameter ‘Dtype’
output_blobs[i]->mutable_cpu_diff());
^
/home/papa/caffe_torch_binding/caffe.cpp:115:45: error: no matching function for call to ‘caffe::Blob::mutable_gpu_diff()’
output_blobs[i]->mutable_gpu_diff());
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:521:10: note: candidate: template Dtype* caffe::Blob::mutable_gpu_diff()
Dtype* mutable_gpu_diff() {
^
/home/papa/caffe/include/caffe/blob.hpp:521:10: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:115:45: note: couldn't deduce template parameter ‘Dtype’
output_blobs[i]->mutable_gpu_diff());
^
/home/papa/caffe_torch_binding/caffe.cpp:131:68: error: no matching function for call to ‘caffe::Blob::cpu_diff()’
caffe_copy(input_blobs[i]->count(), input_blobs[i]->cpu_diff(), data_ptr)
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:326:16: note: candidate: template const Dtype* caffe::Blob::cpu_diff() const
const Dtype* cpu_diff() const {
^
/home/papa/caffe/include/caffe/blob.hpp:326:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:131:68: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(input_blobs[i]->count(), input_blobs[i]->cpu_diff(), data_ptr)
^
/home/papa/caffe_torch_binding/caffe.cpp:134:68: error: no matching function for call to ‘caffe::Blob::gpu_diff()’
caffe_copy(input_blobs[i]->count(), input_blobs[i]->gpu_diff(), data_ptr)
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:498:16: note: candidate: template const Dtype* caffe::Blob::gpu_diff() const
const Dtype* gpu_diff() const {
^
/home/papa/caffe/include/caffe/blob.hpp:498:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:134:68: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(input_blobs[i]->count(), input_blobs[i]->gpu_diff(), data_ptr)
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void read_mean(const char*, THFloatTensor*)’:
/home/papa/caffe_torch_binding/caffe.cpp:145:5: error: ‘caffe::Blob’ is not a template
Blob data_mean;
^
/home/papa/caffe_torch_binding/caffe.cpp:145:17: error: no matching function for call to ‘caffe::Blob::Blob()’
Blob data_mean;
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:54:12: note: candidate: caffe::Blob::Blob(caffe::Type)
explicit Blob(Type dtype)
^
/home/papa/caffe/include/caffe/blob.hpp:54:12: note: candidate expects 1 argument, 0 provided
/home/papa/caffe/include/caffe/blob.hpp:48:3: note: candidate: caffe::Blob::Blob(caffe::Type, caffe::Type)
Blob(Type data_type, Type diff_type)
^
/home/papa/caffe/include/caffe/blob.hpp:48:3: note: candidate expects 2 arguments, 0 provided
/home/papa/caffe_torch_binding/caffe.cpp:153:54: error: no matching function for call to ‘caffe::Blob::cpu_data()’
caffe_copy(data_mean.count(), data_mean.cpu_data(), data_ptr);
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: candidate: template const Dtype* caffe::Blob::cpu_data() const
const Dtype* cpu_data() const {
^
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:153:54: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(data_mean.count(), data_mean.cpu_data(), data_ptr);
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘unsigned int get_blob_index(void**, const char*)’:
/home/papa/caffe_torch_binding/caffe.cpp:158:2: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:158:22: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void get_blob_data(void**, unsigned int, THFloatTensor
)’:
/home/papa/caffe_torch_binding/caffe.cpp:172:2: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:172:22: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:173:20: error: ‘caffe::Blob’ is not a template
boost::shared_ptr<Blob > output_blobs = net_->blobs()[blob_id];
^
/home/papa/caffe_torch_binding/caffe.cpp:179:61: error: no matching function for call to ‘caffe::Blob::cpu_data()’
caffe_copy(output_blobs->count(), output_blobs->cpu_data(), data_ptr);
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: candidate: template const Dtype
caffe::Blob::cpu_data() const
const Dtype* cpu_data() const {
^
/home/papa/caffe/include/caffe/blob.hpp:320:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:179:61: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(output_blobs->count(), output_blobs->cpu_data(), data_ptr);
^
/home/papa/caffe_torch_binding/caffe.cpp:182:61: error: no matching function for call to ‘caffe::Blob::gpu_data()’
caffe_copy(output_blobs->count(), output_blobs->gpu_data(), data_ptr);
^
In file included from /home/papa/caffe/include/caffe/caffe.hpp:7:0,
from /home/papa/caffe_torch_binding/caffe.cpp:5:
/home/papa/caffe/include/caffe/blob.hpp:492:16: note: candidate: template const Dtype* caffe::Blob::gpu_data() const
const Dtype* gpu_data() const {
^
/home/papa/caffe/include/caffe/blob.hpp:492:16: note: template argument deduction/substitution failed:
/home/papa/caffe_torch_binding/caffe.cpp:182:61: note: couldn't deduce template parameter ‘Dtype’
caffe_copy(output_blobs->count(), output_blobs->gpu_data(), data_ptr);
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void reshape(void**, int, int, int, int)’:
/home/papa/caffe_torch_binding/caffe.cpp:190:2: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:190:22: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:191:2: error: ‘caffe::Blob’ is not a template
Blob
input_layer = net_->input_blobs()[0];
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void save_model(void**, char*)’:
/home/papa/caffe_torch_binding/caffe.cpp:198:2: error: ‘caffe::Net’ is not a template
Net* net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:198:22: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp: In function ‘void reset(void**)’:
/home/papa/caffe_torch_binding/caffe.cpp:206:3: error: ‘caffe::Net’ is not a template
Net
net_ = (Net)handle[1];
^
/home/papa/caffe_torch_binding/caffe.cpp:206:23: error: ‘caffe::Net’ is not a template
Net
net_ = (Net*)handle[1];
^
CMakeFiles/tcaffe.dir/build.make:62: recipe for target 'CMakeFiles/tcaffe.dir/caffe.cpp.o' failed
make[2]: *** [CMakeFiles/tcaffe.dir/caffe.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tcaffe.dir/all' failed
make[1]: *** [CMakeFiles/tcaffe.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

I am thinking it has to do with my compiler, but I don't know which version I should use.
papa@beye:$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1
16.04.11) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.