caffe test model weights

31 views
Skip to first unread message

Shaun Elliott

unread,
May 29, 2017, 4:44:36 PM5/29/17
to Caffe Users
I am training a model based on the imagenet example, but I don't know how to use the test script.

I am doing this:
/usr/local/caffe/build/tools/caffe test -model=caffenet_train_iter_110000.caffemodel

But, I get this error:

F0529 20:36:45.142068 29054 caffe.cpp:263] Check failed: FLAGS_weights.size() > 0 (0 vs. 0) Need model weights to score. *** Check failure stack trace: ***

Where do I find the model weights to input to this script?

I read the help doc:
-weights (Optional; the pretrained weights to initialize finetuning, separated by ','. Cannot be set simultaneously with snapshot.) type: string default: ""

But nothing in my solver file is obvious:
net: "train_val.prototxt" test_iter: 1000 test_interval: 1000 base_lr: 0.01 lr_policy: "step" gamma: 0.1 stepsize: 100000 display: 20 max_iter: 450000 momentum: 0.9 weight_decay: 0.0005 snapshot: 10000 snapshot_prefix: "caffenet_train" solver_mode: GPU

Are my weights this? 0.9,0.0005 Or, is there some other weights I should use?

I've also tried this:
caffe test -model=caffenet_train_iter_110000.solverstate -weights=0.9,0.0005

And I get an entirely different error.

Shaun Elliott

unread,
May 30, 2017, 12:19:55 AM5/30/17
to Caffe Users
Actually, it looks like I was passing the wrong model file. I ran it this way, and it seems to work now:

caffe test  -model=train_val.prototxt -weights=caffenet_train_iter_7000.caffemodel
Reply all
Reply to author
Forward
0 new messages