参考:https://blog.csdn.net/menglanzeng/article/details/89284515
I1221 14:40:57.487751 15003 sgd_solver.cpp:106] Iteration 0, lr = 0.001
F1221 14:40:57.493633 15003 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0) out of memory
*** Check failure stack trace: ***
@ 0x7f2f64ed0daa (unknown)
@ 0x7f2f64ed0ce4 (unknown)
@ 0x7f2f64ed06e6 (unknown)
@ 0x7f2f64ed3687 (unknown)
@ 0x7f2f655da931 caffe::SyncedMemory::to_gpu()
@ 0x7f2f655d9c99 caffe::SyncedMemory::mutable_gpu_data()
@ 0x7f2f654d4462 caffe::Blob<>::mutable_gpu_data()
@ 0x7f2f6561e26c caffe::SGDSolver<>::ComputeUpdateValue()
@ 0x7f2f6561ec63 caffe::SGDSolver<>::ApplyUpdate()
@ 0x7f2f654cf68c caffe::Solver<>::Step()
@ 0x7f2f654cfe99 caffe::Solver<>::Solve()
@ 0x408b0b train()
@ 0x405e6c main
@ 0x7f2f6372bf45 (unknown)
@ 0x406773 (unknown)
@ (nil) (unknown)
解决方法:batch_size太大了,一次性读入的图片太多了,所以就超出了显存。因此需要将train.prototxt中的文件train和test的batch_size调小一点。这里调成了batch_size = 2.
1.train:
./caffe-segnet/build/tools/caffe train -solver ./Models/segnet_solver.prototxt
2.change the path of test.txt in segnet_inference.prototxt
sudo python ./Scripts/compute_bn_statistics.py ./Models/segnet_train.prototxt ./Models/Training/segnet_iter_40000.caffemodel ./Models/Inference/
sudo python ./Scripts/test_segmentation_camvid.py --model ./Models/segnet_inference.prototxt --weights ./Models/Inference/test_weights.caffemodel --iter 233
sudo python ./Scripts/test_segmentation_camvid.py --model ./Models/segnet_basic_inference.prototxt --weights ./Models/Inference/test_weights.caffemodel --iter 233
1.train:
./caffe-segnet/build/tools/caffe train -solver ./Models/segnet_solver.prototxt
2.change the path of test.txt in segnet_inference.prototxt
sudo python ./Scripts/compute_bn_statistics.py ./Models/segnet_train.prototxt ./Models/Training/segnet_iter_40000.caffemodel ./Models/Inference/
sudo python ./Scripts/test_segmentation_camvid.py --model ./Models/segnet_inference.prototxt --weights ./Models/Inference/test_weights.caffemodel --iter 233
sudo python ./Scripts/test_segmentation_camvid.py --model ./Models/segnet_basic_inference.prototxt --weights ./Models/Inference/test_weights.caffemodel --iter 233
./build/segmentation ../Example_Models/segnet_basic_camvid.prototxt ../segnet_basic_camvid.caffemodel ../000653.png ./pascal.png