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 的文件名字 中间有空格!!! 把文件夹路径上的名字去掉,果断就可以了。

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=solverprotoweights=weights_solverstate  2>&1 | tee -a $log_filename

 

目录
打赏
0
0
0
0
8
分享
相关文章
Warning: Can save best model only with val_acc available, skipping
本文解决了在使用DenseNet网络结构保存最优模型时出现的"Warning: Can save best model only with val_acc available, skipping"问题,方法是将`ModelCheckpoint`回调函数中的`monitor`参数值从`val_acc`改为`val_accuracy`。
RuntimeError: Given groups=1, weight of size 64 128 1 7, expected input[16,
RuntimeError: Given groups=1, weight of size 64 128 1 7, expected input[16,
3041 0
【Tensorflow】Found unexpected keys that do not correspond to any Model output: dict_keys([‘model_outp
文章讨论了在使用Tensorflow 2.3时遇到的错误信息:"Found unexpected keys that do not correspond to any Model output: dict_keys(['model_output']). Expected: ['dense']"。这个问题通常发生在模型的输出层命名与model.fit_generator的生成器函数中返回的值的键不匹配时。
69 1
加载模型出现-RuntimeError: Error(s) in loading state_dict for Net:unexpected key(s) in state_dict: XXX
加载模型出现-RuntimeError: Error(s) in loading state_dict for Net:unexpected key(s) in state_dict: XXX
617 0
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
TensorFlow2._:model.summary() Output Shape为multiple解决方法
TensorFlow2._:model.summary() Output Shape为multiple解决方法
312 0
TensorFlow2._:model.summary() Output Shape为multiple解决方法
【CatBoost报错解决】CatBoostError: Bad value for num feature[non default doc idx=0,feature idx=19]=
【CatBoost报错解决】CatBoostError: Bad value for num feature[non default doc idx=0,feature idx=19]=
Expected more than 1 value per channel when training, got input size torch.Size
因为模型中用了batchnomolization,训练中用batch训练的时候当前batch恰好只含一个sample,而由于BatchNorm操作需要多于一个数据计算平均值,因此造成该错误。
994 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
302 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
595 0
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em