Trying to run a model trained on Digits on the Caffe web demo

405 views
Skip to first unread message

rob lu

unread,
Jul 23, 2015, 10:01:31 PM7/23/15
to DIGITS Users
I trained a model  on Digits and it seemed to run fine there.   
Then i exported the trained model files and  copied them into a different system running the standard caffe web demo. 
I hoped to just be able to plug those files in and have them run in Caffe but i am getting an error.
Specifically i copied my model into bvlc_reference_caffenet.caffemodel, the  deploy.prototxt into deploy.prototxt, and the  mean.binaryproto into the  ilsvrc_2012_mean.npy file. 
However when i try to run it , it appears to not like the format of the mean.binaryproto file as indicated by the error message:

IOError: Failed to interpret file '/home/vagrant/caffe/python/caffe/imagenet/ilsvrc_2012_mean.npy' as a pickle


what am i doing wrong here? Do i need to process the mean.binaryproto file somehow before i use it with caffe?

Luke Yeager

unread,
Jul 24, 2015, 1:08:09 PM7/24/15
to DIGITS Users, dao...@gmail.com, dao...@gmail.com
.binaryproto is a different format from .npy. You can get the DIGITS create_db tool to generate a mean.npy file for you if you use the tool manually.

# See all the options
./tools/create_db.py --help
# Something like this
./tools/create_db.py train_images.txt train_lmdb 256 256 --mean_file=mean.npy

Unfortunately, I don't have a tool for you to convert the .binaryproto mean to a .npy file after the fact.

rob lu

unread,
Jul 24, 2015, 10:14:38 PM7/24/15
to DIGITS Users, luke....@gmail.com
Thanks Luke- maybe i'm approaching this wrong----i am trying to take the model i trained on DIGITS and run it on an Nvidia Jetson card using the basic Caffe framework, but should i instead just be running it on DIGITS installed on the Jetson card to avoid the conversion you mentioned?

Allison Gray

unread,
Jul 24, 2015, 10:33:12 PM7/24/15
to DIGITS Users, dao...@gmail.com, dao...@gmail.com
I think your approach is OK.

I convert my mean.binaryproto files to a .npy to perform classification with my trained networks using python. Here is another example for converting the file to  a .npy.


This is the approach I used to perform classification on the Jetson. I built caffe, and then used the example script in that link above to convert my mean.binaryproto to a npy. 

I have not tried to use DIGITS on the Jetson.





On Thursday, July 23, 2015 at 7:01:31 PM UTC-7, rob lu wrote:
Reply all
Reply to author
Forward
0 new messages