安装caffe
1.从github直接下载caffe到服务器上
git clone https://github
.com
/BVLC/caffe
.git
2.因为是服务器原因,之前各种依赖包已经拥有,所以不用下载
3.进入caffe文件夹,可以看到里面有以下两个文件
cd caffe
sudo
cp
Makefile
.config
.example
Makefile
.config
//将Makefile
.config
.example
的内容复制到Makefile
.config
//因为make指令只能make Makefile
.config
文件,而Makefile
.config
.example
是caffe给出的makefile例子
sudo gedit Makefile
.config
//打开Makefile
.config
文件,如果你有其他编辑器的话,也不用执行这步,比如我用的mobaxterm就是直接双击打开就好,不同的方法,一样的结果
4.打开之后,做如下修改
修改为: INCLUDE_DIRS
:=
$(PYTHON_INCLUDE) /usr/
local
/include /usr/include/hdf5/serial
LIBRARY_DIRS
:=
$(PYTHON_LIB) /usr/
local
/lib /usr/lib /usr/lib/x86_64
-linux
-gnu
/usr/lib/x86_64
-linux
-gnu
/hdf5/serial
5.打开makefile文件,这个跟上面的两个不是同一个(在这里有一个断层,隔了很久才开始写)
6.尝试编译fastrcnn时出现了错误,回来看一看caffe是否编译成功 make
make test
LD .build_release/src/caffe/test/test_net.o
LD .build_release/src/caffe/test/test_filler.o
LD .build_release/src/caffe/test/test_inner_product_layer.o
LD .build_release/src/caffe/test/test_softmax_with_loss_layer.o
LD .build_release/src/caffe/test/test_softmax_layer.o
LD .build_release/src/caffe/test/test_hinge_loss_layer.o
LD .build_release/src/caffe/test/test_layer_factory.o
LD .build_release/src/caffe/test/test_sigmoid_cross_entropy_loss_layer.o
LD .build_release/src/caffe/test/test_solver.o
LD .build_release/src/caffe/test/test_split_layer.o
LD .build_release/src/caffe/test/test_common.o
LD .build_release/src/caffe/test/test_argmax_layer.o
LD .build_release/src/caffe/test/test_gradient_based_solver.o
LD .build_release/src/caffe/test/test_filter_layer.o
LD .build_release/src/caffe/test/test_math_functions.o
LD .build_release/src/caffe/test/test_rnn_layer.o
LD .build_release/src/caffe/test/test_data_transformer.o
LD .build_release/src/caffe/test/test_hdf5data_layer.o
LD .build_release/src/caffe/test/test_memory_data_layer.o
LD .build_release/src/caffe/test/test_eltwise_layer.o
LD .build_release/src/caffe/test/test_image_data_layer.o
LD .build_release/src/caffe/test/test_crop_layer.o
LD .build_release/src/caffe/test/test_convolution_layer.o
LD .build_release/src/caffe/test/test_batch_reindex_layer.o
LD .build_release/src/caffe/test/test_tile_layer.o
LD .build_release/src/caffe/test/test_deconvolution_layer.o
LD .build_release/src/caffe/test/test_db.o
LD .build_release/src/caffe/test/test_neuron_layer.o
LD .build_release/src/caffe/test/test_spp_layer.o
LD .build_release/src/caffe/test/test_multinomial_logistic_loss_layer.o
LD .build_release/src/caffe/test/test_contrastive_loss_layer.o
LD .build_release/src/caffe/test/test_upgrade_proto.o
LD .build_release/src/caffe/test/test_tanh_layer.o
LD .build_release/src/caffe/test/test_reshape_layer.o
LD .build_release/src/caffe/test/test_data_layer.o
LD .build_release/src/caffe/test/test_threshold_layer.o
LD .build_release/src/caffe/test/test_euclidean_loss_layer.o
LD .build_release/src/caffe/test/test_syncedmem.o
LD .build_release/src/caffe/test/test_lstm_layer.o
LD .build_release/src/caffe/test/test_power_layer.o
LD .build_release/src/caffe/test/test_infogain_loss_layer.o
LD .build_release/src/caffe/test/test_blob.o
LD .build_release/src/caffe/test/test_batch_norm_layer.o
LD .build_release/src/caffe/test/test_dummy_data_layer.o
LD .build_release/src/caffe/test/test_reduction_layer.o
LD .build_release/src/caffe/test/test_embed_layer.o
LD .build_release/src/caffe/test/test_internal_thread.o
LD .build_release/src/caffe/test/test_accuracy_layer.o
LD .build_release/src/caffe/test/test_hdf5_output_layer.o
LD .build_release/src/caffe/test/test_lrn_layer.o
LD .build_release/src/caffe/test/test_maxpool_dropout_layers.o
LD .build_release/src/caffe/test/test_util_blas.o
LD .build_release/src/caffe/test/test_concat_layer.o
LD .build_release/src/caffe/test/test_scale_layer.o
LD .build_release/src/caffe/test/test_slice_layer.o
LD .build_release/src/caffe/test/test_benchmark.o
LD .build_release/src/caffe/test/test_mvn_layer.o
LD .build_release/src/caffe/test/test_bias_layer.o
LD .build_release/src/caffe/test/test_im2col_layer.o
LD .build_release/src/caffe/test/test_platform.o
LD .build_release/src/caffe/test/test_io.o
LD .build_release/src/caffe/test/test_stochastic_pooling.o
LD .build_release/src/caffe/test/test_pooling_layer.o
LD .build_release/src/caffe/test/test_flatten_layer.o
LD .build_release/src/caffe/test/test_protobuf.o
LD .build_release/cuda/src/caffe/test/test_im2col_kernel.o
make runtest ,一直没有问题
3.感觉好像是caffe编译成功,但fastrcnn不能。
4.确实如此,现在在fast-rcnn/lib 目录下make没有问题
5.然后按照教程修改config文件
https://blog.csdn.net/u011635764/article/details/52831167
没有问题
6.问题更改为:
推测是hdf5文件的问题。
7.搜索发现makefile不加config的那个文件中也需要修改
https://www.cnblogs.com/zjutzz/p/6034408.html
我这样更改了
#libraries变量,hdf5的库名,发生变化,由hdf5_hl变为hdf_serial_hl,hdf5变为hdf5_serial
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf_serial_hl hdf5_serial
教程里老版本cuda还需修改nvcc,但我的是9.0,不用修改。
!!!!!原作者输入有误,复制错了!!!hdf那里少了个5
8.继续编译,依旧有问题
按照https://blog.csdn.net/m0_37477175/article/details/78151283,在makefile。config里面修改include_dir
9.再继续编译。问题发生变化
根据https://blog.csdn.net/tjuyanming/article/details/79249964修改
注释掉,应该是cuda版本的问题。
要记得make clean,然后make -j8.
10.出现新问题
之前hdf那里少了个5 ,已解决
11.出现了新问题,下次再说,要去吃饭领快递了
11.我继续弄啦,进入
然后执行
make -j的命令,居然没有问题了,奇怪。
12.那么执行 make pycaffe命令
okkk,依旧没有问题,奇怪 ,那我下午是为什么出问题啊
13.好的,到这里编译就结束了,接下来测试模型!