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

error from make -j8 & make pycaffee #1

Open
SeunghoHan opened this issue Nov 25, 2018 · 1 comment
Open

error from make -j8 & make pycaffee #1

SeunghoHan opened this issue Nov 25, 2018 · 1 comment

Comments

@SeunghoHan
Copy link

SeunghoHan commented Nov 25, 2018

Hello,
Thank you for your sharing the code of up-down-captioner.
Actually, I have some question..

During the make -j8 & make pycaffee following your instruction,
some errors occurred in src/caffe/layers/beam_search_node_layer.cpp.
The detailed errors are below.

And I tried make -j8 & make pycaffee step by removing beam_search_node_layer.cpp and beam_search_node_layer.cu files. The step was passed, but I cannot use the Demo.ipynb in the line of 'Load captioning model'.
Maybe it was caused from the beam_search_node_layer.cpp.

So.. have you any comment or idea for solving this problem?
My environment is as follows:

  • Ubuntu 16.04
  • Python: 2.7.13 (Anaconda)
  • gcc version: 5.4.0
  • installed needed libs

-- Detailed errors during make beam_search_node_layer.cpp.
....
CXX src/caffe/layers/elu_layer.cpp
CXX src/caffe/layers/lstm_unit_layer.cpp
** occuring error**
src/caffe/layers/beam_search_node_layer.cpp: In instantiation of \u2018void caffe::BeamSearchNodeLayer::Forward_cpu(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]\u2019:
src/caffe/layers/beam_search_node_layer.cpp:208:1: required from here
src/caffe/layers/beam_search_node_layer.cpp:97:51: error: no matching function for call to \u2018make_pair(const float&, float)\u2019
cpu_beams_.push_back(make_pair<Dtype, int>(partial_sum[src], ix + end_of_sequence_));
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/vector:60,
from src/caffe/layers/beam_search_node_layer.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:276:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make_pair(_T1&& __x, T2&& y)
^
/usr/include/c++/5/bits/stl_pair.h:276:5: note: template argument deduction/substitution failed:
src/caffe/layers/beam_search_node_layer.cpp:97:63: note: cannot convert \u2018*(partial_sum + ((sizetype)(((long unsigned int)src) * 4ul)))\u2019 (type \u2018const float\u2019) to type \u2018float&&\u2019
cpu_beams
.push_back(make_pair<Dtype, int>(partial_sum[src], ix + end_of_sequence
));
^
src/caffe/layers/beam_search_node_layer.cpp:108:54: error: no matching function for call to \u2018make_pair(const float&, int)\u2019
cpu_beams
.push_back(make_pair<Dtype,int>(score[ix+w],ix+w));
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/vector:60,
from src/caffe/layers/beam_search_node_layer.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:276:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make_pair(_T1&& __x, T2&& y)
^
/usr/include/c++/5/bits/stl_pair.h:276:5: note: template argument deduction/substitution failed:
src/caffe/layers/beam_search_node_layer.cpp:108:60: note: cannot convert \u2018*(score + ((sizetype)(((long unsigned int)(ix + w)) * 4ul)))\u2019 (type \u2018const float\u2019) to type \u2018float&&\u2019
cpu_beams
.push_back(make_pair<Dtype,int>(score[ix+w],ix+w));
^
src/caffe/layers/beam_search_node_layer.cpp: In instantiation of \u2018void caffe::BeamSearchNodeLayer::Forward_cpu(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = double]\u2019:
src/caffe/layers/beam_search_node_layer.cpp:208:1: required from here
src/caffe/layers/beam_search_node_layer.cpp:97:51: error: no matching function for call to \u2018make_pair(const double&, double)\u2019
cpu_beams
.push_back(make_pair<Dtype, int>(partial_sum[src], ix + end_of_sequence
));
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/vector:60,
from src/caffe/layers/beam_search_node_layer.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:276:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make_pair(_T1&& __x, T2&& y)
^
/usr/include/c++/5/bits/stl_pair.h:276:5: note: template argument deduction/substitution failed:
src/caffe/layers/beam_search_node_layer.cpp:97:63: note: cannot convert \u2018*(partial_sum + ((sizetype)(((long unsigned int)src) * 8ul)))\u2019 (type \u2018const double\u2019) to type \u2018double&&\u2019
cpu_beams
.push_back(make_pair<Dtype, int>(partial_sum[src], ix + end_of_sequence
));
^
src/caffe/layers/beam_search_node_layer.cpp:108:54: error: no matching function for call to \u2018make_pair(const double&, int)\u2019
cpu_beams
.push_back(make_pair<Dtype,int>(score[ix+w],ix+w));
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/vector:60,
from src/caffe/layers/beam_search_node_layer.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:276:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make_pair(_T1&& __x, _T2&& _y)
^
/usr/include/c++/5/bits/stl_pair.h:276:5: note: template argument deduction/substitution failed:
src/caffe/layers/beam_search_node_layer.cpp:108:60: note: cannot convert \u2018*(score + ((sizetype)(((long unsigned int)(ix + w)) * 8ul)))\u2019 (type \u2018const double\u2019) to type \u2018double&&\u2019
cpu_beams
.push_back(make_pair<Dtype,int>(score[ix+w],ix+w));
^
Makefile:584: recipe for target '.build_release/src/caffe/layers/beam_search_node_layer.o' failed
make: *** [.build_release/src/caffe/layers/beam_search_node_layer.o] Error 1
make: *** Waiting for unfinished jobs....

@SeunghoHan
Copy link
Author

I solved it!
I just removed '<Dtype, int>' for all lines with make_pair().

Maybe it seems to be due to the version of C++.
In my case, I used C++11, but it caused above problem.

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