現在、ubuntu16.04からubuntu18.04に移行中です。
そして、gccも5.4.0から7.3.0に上がろうとしています。
そして、ubuntu16.04では出なかったエラーが生じました。
それは、「std::max」のところで起きていて、エラーメッセージの一部は次のとおりです。
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘float’ Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), 0.0); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/7/algorithm:62:0, from src/caffe/layers/contrastive_loss_layer.cpp:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘float’ Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), 0.0); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Makefile:517: recipe for target '.build_release/src/caffe/layers/contrastive_loss_layer.o' failed make: *** [.build_release/src/caffe/layers/contrastive_loss_layer.o] Error 1
何か回避策があると思うのですが、わかる方ご教示ください。
【環境】
OS:ubuntu18.04
gcc:7.3.0
python:3.6
回答1件
あなたの回答
tips
プレビュー