- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我得到了一个关于 Visualize-features 函数的 cpp。我想编译它,但有一些错误。我将 Visualize_features.cpp 移动到 CAFFE_ROOT/build/tools/并使用以下命令:外壳命令:
g++ -v visualize_features.cpp -o visualize_features
visualize_feature.cpp:
// Copyright 2013 Yangqing Jia
//
// This is a simple script that allows one to quickly test a network whose
// structure is specified by text format protocol buffers, and whose parameter
// are loaded from a pre-trained network.
// Usage:
// test_net net_proto pretrained_net_proto iterations [CPU/GPU]
#include <cuda_runtime.h>
#include <fstream>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <utility>
#include "caffe/caffe.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>
#include <opencv2/imgproc/imgproc.hpp>
using std::make_pair;
using std::pair;
using namespace caffe; // NOLINT(build/namespaces)
using namespace std;
vector<string> fileNames;
char * filelist;
/*
* 读入的文件的内容格式类似这样子的:全局id 类名_所在类的id.jpg
0 一步裙_0.jpg
1 一步裙_1.jpg
2 一步裙_10.jpg
*/
void readFile()
{
if(fileNames.empty())
{
ifstream read(filelist);
//"/home/linger/linger/testfile/test_attachment/image_filename"
// "/home/linger/imdata/test_files_collar.txt"
// "/home/linger/linger/testfile/testfilename"
if(read.is_open())
{
while(!read.eof())
{
string name;
int id;
read>>id>>name;
fileNames.push_back(name);
}
}
}
}
/*
* 根据图片id获取类名
*/
string getClassNameById(int id)
{
readFile();
int index = fileNames[id].find_last_of('_') ;
return fileNames[id].substr(0, index);
}
void writeBatch(const float* data,int num,int channels,int width,int height,int startID,const char*dir)
{
for(int id = 0;id<num;id++)
{
for(int channel=0;channel<channels;channel++)
{
cv::Mat mat(height,width, CV_8UC1);//高宽
vector<vector<float> > vec;
vec.resize(height);
float max = -1;
float min = 999999;
for(int row=0;row<height;row++)
{
vec[row].resize(width);
for(int col=0;col<width;col++)
{
vec[row][col] =
data[id*channels*width*height+channel*width*height+row*width+col];
if(max<vec[row][col])
{
max = vec[row][col];
}
if(min>vec[row][col])
{
min = vec[row][col];
}
}
}
for(int row=0;row<height;row++)
{
for(int col=0;col<width;col++)
{
vec[row][col] = 255*((float)(vec[row][col]-min))/(max-min);
uchar& img = mat.at<uchar>(row,col);
img= vec[row][col];
}
}
char filename[100];
string label = getClassNameById(startID+id);
string file_reg =dir;
file_reg+="%s%05d_%05d.png";
snprintf(filename, 100, file_reg.c_str(), label.c_str(),startID+id,channel);
//printf("%s\n",filename);
cv::imwrite(filename, mat);
}
}
}
int main(int argc, char** argv)
{
if (argc < 4)
{
LOG(ERROR) << "visualize_features.bin net_proto pretrained_net_proto iterations "
<< "[CPU/GPU] img_list_file dstdir laydepth";
return 0;
}
/*
//visualize_features.bin /home/linger/linger/caffe-action/caffee-ext/Caffe_MM/prototxt/triplet/triplet_test_simple.prototxt /home/linger/linger/caffe-action/caffee-ext/Caffe_MM/snapshorts/_iter_100000 8 GPU /home/linger/linger/testfile/test_attachment/image_filename /home/linger/linger/testfile/innerproduct/ 6
*/
filelist = argv[5];
cudaSetDevice(0);
//Caffe::set_phase(Caffe::TEST);
//Phase phase = TEST;
if (argc == 5 && strcmp(argv[4], "GPU") == 0)
{
LOG(ERROR) << "Using GPU";
Caffe::set_mode(Caffe::GPU);
}
else
{
LOG(ERROR) << "Using CPU";
Caffe::set_mode(Caffe::CPU);
}
NetParameter test_net_param;
ReadProtoFromTextFile(argv[1], &test_net_param);
//Net<float> caffe_test_net(&test_net_param,TEST);
shared_ptr<Net<float> > caffe_test_net;
caffe_test_net.reset(new Net<float>(argv[1],TEST));
NetParameter trained_net_param;
ReadProtoFromBinaryFile(argv[2], &trained_net_param);
caffe_test_net->CopyTrainedLayersFrom(argv[2]);
int total_iter = atoi(argv[3]);
LOG(ERROR) << "Running " << total_iter << " Iterations.";
double test_accuracy = 0;
vector<Blob<float>*> dummy_blob_input_vec;
int startID = 0;
int nums;
int dims;
int batchsize = test_net_param.layers(0).layer().batchsize();
int laynum = caffe_test_net->bottom_vecs().size();
printf("num of layers:%d\n",laynum);
for (int i = 0; i < total_iter; ++i)
{
const vector<Blob<float>*>& result =
caffe_test_net->Forward(dummy_blob_input_vec);
int laydepth = atoi(argv[7]);
Blob<float>* features = (*(caffe_test_net->bottom_vecs().begin()+laydepth))[0];//调整第几层即可
nums = features->num();
dims= features->count()/features->num();
int num = features->num();
int channels = features->channels();
int width = features->width();
int height = features->height();
printf("channels:%d,width:%d,height:%d\n",channels,width,height);
writeBatch(features->cpu_data(),num,channels,width,height,startID,argv[6]);
startID += nums;
}
return 0;
}
错误:
weilam@linux:~/soft/caffe-master/tools$ g++ -v visualize_features.cpp -o visualize_features
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
COLLECT_GCC_OPTIONS='-v' '-o' 'visualize_features' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE visualize_features.cpp -quiet -dumpbase visualize_features.cpp -mtune=generic -march=x86-64 -auxbase visualize_features -version -fstack-protector -Wformat -Wformat-security -o /tmp/ccDLiCXS.s
GNU C++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) version 4.8.4 (x86_64-linux-gnu)
compiled by GNU C version 4.8.4, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/4.8"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include
/home/weilam/soft/caffe-master/include
/home/weilam/soft/caffe-master/distribute/include
/usr/local/cuda/include
.
/usr/include/c++/4.8
/usr/include/x86_64-linux-gnu/c++/4.8
/usr/include/c++/4.8/backward
/usr/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu
End of search list.
GNU C++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) version 4.8.4 (x86_64-linux-gnu)
compiled by GNU C version 4.8.4, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 83f8d9bb238019ed17000f1b7e141e5a
COLLECT_GCC_OPTIONS='-v' '-o' 'visualize_features' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
as -v --64 -o /tmp/cctbPuju.o /tmp/ccDLiCXS.s
GNU assembler version 2.24 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.24
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'visualize_features' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o visualize_features /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. /tmp/cctbPuju.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
/tmp/cctbPuju.o: In function `writeBatch(float const*, int, int, int, int, int, char const*)':
visualize_features.cpp:(.text+0x6d8): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
visualize_features.cpp:(.text+0x724): undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/tmp/cctbPuju.o: In function `main':
visualize_features.cpp:(.text+0x8e7): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
visualize_features.cpp:(.text+0x8f6): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text+0x91f): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0x945): undefined reference to `cudaSetDevice'
visualize_features.cpp:(.text+0x98b): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
visualize_features.cpp:(.text+0x99a): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text+0x9b6): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0x9e0): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
visualize_features.cpp:(.text+0x9ef): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text+0xa0b): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xa24): undefined reference to `caffe::NetParameter::NetParameter()'
visualize_features.cpp:(.text+0xa44): undefined reference to `caffe::ReadProtoFromTextFile(char const*, google::protobuf::Message*)'
visualize_features.cpp:(.text+0xab2): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase, caffe::Net<float> const*)'
visualize_features.cpp:(.text+0xaf1): undefined reference to `caffe::NetParameter::NetParameter()'
visualize_features.cpp:(.text+0xb11): undefined reference to `caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::Message*)'
visualize_features.cpp:(.text+0xb68): undefined reference to `caffe::Net<float>::CopyTrainedLayersFrom(std::string)'
visualize_features.cpp:(.text+0xbc0): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
visualize_features.cpp:(.text+0xbcf): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text+0xc08): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xcc8): undefined reference to `caffe::Net<float>::Forward(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, float*)'
visualize_features.cpp:(.text+0xe3c): undefined reference to `caffe::Blob<float>::cpu_data() const'
visualize_features.cpp:(.text+0xeb5): undefined reference to `caffe::NetParameter::~NetParameter()'
visualize_features.cpp:(.text+0xed3): undefined reference to `caffe::NetParameter::~NetParameter()'
visualize_features.cpp:(.text+0xeec): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xf09): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xf26): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xfa3): undefined reference to `google::LogMessage::~LogMessage()'
visualize_features.cpp:(.text+0xfcb): undefined reference to `caffe::NetParameter::~NetParameter()'
visualize_features.cpp:(.text+0xff3): undefined reference to `caffe::NetParameter::~NetParameter()'
/tmp/cctbPuju.o: In function `__static_initialization_and_destruction_0(int, int)':
visualize_features.cpp:(.text+0x104a): undefined reference to `boost::system::generic_category()'
visualize_features.cpp:(.text+0x1056): undefined reference to `boost::system::generic_category()'
visualize_features.cpp:(.text+0x1062): undefined reference to `boost::system::system_category()'
/tmp/cctbPuju.o: In function `caffe::Caffe::set_mode(caffe::Caffe::Brew)':
visualize_features.cpp:(.text._ZN5caffe5Caffe8set_modeENS0_4BrewE[_ZN5caffe5Caffe8set_modeENS0_4BrewE]+0xc): undefined reference to `caffe::Caffe::Get()'
/tmp/cctbPuju.o: In function `caffe::V1LayerParameter::layer() const':
visualize_features.cpp:(.text._ZNK5caffe16V1LayerParameter5layerEv[_ZNK5caffe16V1LayerParameter5layerEv]+0x28): undefined reference to `caffe::V1LayerParameter::default_instance_'
/tmp/cctbPuju.o: In function `cv::Mat::~Mat()':
visualize_features.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)'
/tmp/cctbPuju.o: In function `cv::Mat::create(int, int, int)':
visualize_features.cpp:(.text._ZN2cv3Mat6createEiii[_ZN2cv3Mat6createEiii]+0x8e): undefined reference to `cv::Mat::create(int, int const*, int)'
/tmp/cctbPuju.o: In function `cv::Mat::release()':
visualize_features.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()'
/tmp/cctbPuju.o: In function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
visualize_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x24): undefined reference to `google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)'
visualize_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x4b): undefined reference to `google::base::CheckOpMessageBuilder::ForVar2()'
visualize_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x66): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
visualize_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x75): undefined reference to `google::base::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
visualize_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x89): undefined reference to `google::base::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
/tmp/cctbPuju.o: In function `google::protobuf::RepeatedPtrField<caffe::V1LayerParameter>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<caffe::V1LayerParameter>::TypeHandler>(int) const':
visualize_features.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi]+0x45): undefined reference to `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)'
visualize_features.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi]+0x5b): undefined reference to `google::protobuf::internal::LogMessage::operator<<(char const*)'
visualize_features.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi]+0x73): undefined reference to `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)'
visualize_features.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi]+0x87): undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()'
visualize_features.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN5caffe16V1LayerParameterEE11TypeHandlerEEERKNT_4TypeEi]+0xc2): undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()'
/tmp/cctbPuju.o: In function `caffe::Blob<float>::LegacyShape(int) const':
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x74): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x80): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x99): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0xf8): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x104): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x110): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x16f): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x17b): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x187): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x1e1): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x1ed): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE11LegacyShapeEi[_ZNK5caffe4BlobIfE11LegacyShapeEi]+0x1f9): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
/tmp/cctbPuju.o: In function `caffe::Blob<float>::CanonicalAxisIndex(int) const':
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x9b): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0xa7): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x100): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x18d): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x199): undefined reference to `google::LogMessage::stream()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x1f2): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x21c): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
visualize_features.cpp:(.text._ZNK5caffe4BlobIfE18CanonicalAxisIndexEi[_ZNK5caffe4BlobIfE18CanonicalAxisIndexEi]+0x242): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
collect2: error: ld returned 1 exit status
最佳答案
由于您的源代码存在于 caffe-master
的 tools
文件夹中,因此您可以通过执行 caffe
的常规 make 命令来创建可执行文件,并且名为 visualize_features.bin
的可执行文件应存在于 build/tools
文件夹中。这对您来说是最简单的方法。
您当前使用的构建命令非常不完整,没有提到各种依赖项的包含文件夹和各种库的路径。我认为您必须学习如何编写 Makefile
。
关于c++ - 如何在linux下基于caffe编译cpp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36821271/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
Linux 管道可以缓冲多少数据?这是可配置的吗? 如果管道的两端在同一个进程中,但线程不同,这会有什么不同吗? 请注意:这个“同一个进程,两个线程”的问题是理论上的边栏,真正的问题是关于缓冲的。 最
我找到了here [最后一页] 一种有趣的通过 Linux 启动 Linux 的方法。不幸的是,它只是被提及,我在网上找不到任何有用的链接。那么有人听说过一种避免引导加载程序而使用 Linux 的方法
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我试图了解 ld-linux.so 如何在 Linux 上解析对版本化符号的引用。我有以下文件: 测试.c: void f(); int main() { f(); } a.c 和 b.c:
与 RetroPie 的工作原理类似,我可以使用 Linux 应用程序作为我的桌面环境吗?我实际上并不需要像实际桌面和安装应用程序这样的东西。我只需要一种干净简单的方法来在 RaspberryPi 上
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
有什么方法可以覆盖现有的源代码,我应该用 PyQt、PyGTK、Java 等从头开始构建吗? 最佳答案 如果您指的是软件本身而不是它所连接的存储库,那么自定义应用程序的方法就是 fork 项目。据我所
我的情况是:我在一个磁盘上安装了两个 linux。我将第一个安装在/dev/sda1 中,然后在/dev/sda2 中安装第二个然后我运行第一个系统,我写了一个脚本来在第一个系统运行时更新它。
我在 i2c-0 总线上使用地址为 0x3f 的系统监视器设备。该设备在设备树中配置有 pmbus 驱动程序。 问题是,加载 linux 内核时,这个“Sysmon”设备没有供电。因此,当我在总线 0
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve thi
我正试图在 linux 模块中分配一大块内存,而 kalloc 做不到。 我知道唯一的方法是使用 alloc_bootmem(unsigned long size) 但我只能从 linux 内核而不是
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我有 .sh 文件来运行应用程序。在该文件中,我想动态设置服务器名称,而不是每次都配置。 我尝试了以下方法,它在 CentOS 中运行良好。 nohup /voip/java/jdk1.8.0_71/
我是在 Linux 上开发嵌入式 C++ 程序的新手。我有我的 Debian 操作系统,我在其中开发和编译了我的 C++ 项目(一个简单的控制台进程)。 我想将我的应用程序放到另一个 Debian 操
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 4 年前。 Improve this ques
我使用4.19.78版本的稳定内核,我想找到带有企鹅二进制数据的C数组。系统启动时显示。我需要在哪里搜索该内容? 我在 include/linux/linux_logo.h 文件中只找到了一些 Log
我知道可以使用 gdb 的服务器模式远程调试代码,我知道可以调试针对另一种架构交叉编译的代码,但是是否可以更进一步,从远程调试 Linux 应用程序OS X 使用 gdbserver? 最佳答案 当然
是否有任何可能的方法来运行在另一个 Linux 上编译的二进制文件?我知道当然最简单的是在另一台机器上重建它,但假设我们唯一能得到的是一个二进制文件,那么这可能与否? (我知道这可能并不容易,但我只是
我是一名优秀的程序员,十分优秀!