天天看點

caffe: test code 執行出問題: Check failed: FLAGS_weights.size() > 0 (0 vs. 0) Need model weights to score.

Check failed: FLAGS_weights.size() > 0 (0 vs. 0) Need model weights to score.

出現這個錯誤,但是我記得昨天還好好的,網上搜了也沒有答案,後來仔細檢查才發現,原來存放 .caffemodel 的檔案名字 中間有空格!!!

把檔案夾路徑上的名字去掉,果斷就可以了。。。

solver_proto=/home/wangxiao/Downloads/caffe-master/wangxiao/bvlc_alexnet/test.prototxt

weights_solverstate=/home/wangxiao/Downloads/caffe-master/wangxiao/bvlc_alexnet/Untitled_Folder/_iter_450000.caffemodel

log_filename=/home/wangxiao/Downloads/caffe-master/wangxiao/bvlc_alexnet/log_files/test_web_data_1.log

./build/tools/caffe test \

--model=$solver_proto  --weights=$weights_solverstate  2>&1 | tee -a $log_filename