Cannot run classify.py after installation

238 views
Skip to first unread message

C3P0

unread,
Sep 18, 2016, 11:28:33 PM9/18/16
to Caffe Users
I'm using a Macbook Pro 10.11.6

What I did:
2. I wanted to install using Docker.
3. I downladed and installed Docker.
4. I installed caffe using the instructions on: https://github.com/BVLC/caffe/tree/master/docker
5.
docker run -ti caffe:cpu caffe --version
and 
docker run -ti caffe:cpu bash -c "cd /opt/caffe/build; make runtest"
worked fine.

6. docker run -ti caffe:cpu classify.py --print_results examples/images/cat.jpg foo 
This command failed.

Output: libdc1394 error: Failed to initialize libdc1394

/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.

  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

usage: classify.py [-h] [--model_def MODEL_DEF]

                   [--pretrained_model PRETRAINED_MODEL] [--gpu]

                   [--center_only] [--images_dim IMAGES_DIM]

                   [--mean_file MEAN_FILE] [--input_scale INPUT_SCALE]

                   [--raw_scale RAW_SCALE] [--channel_swap CHANNEL_SWAP]

                   [--ext EXT]

                   input_file output_file

classify.py: error: unrecognized arguments: --print_results 


My problem is I can't find a end to end docker installation.
While the commands on the docker install guide worked, I can't seem to run classify.py.

Even if I do this: docker run -ti caffe:cpu classify.py examples/images/cat.jpg foo

Output:

libdc1394 error: Failed to initialize libdc1394

/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.

  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

CPU mode

WARNING: Logging before InitGoogleLogging() is written to STDERR

W0918 20:24:54.204576     1 _caffe.cpp:122] DEPRECATION WARNING - deprecated use of Python interface

W0918 20:24:54.204727     1 _caffe.cpp:123] Use this instead (with the named "weights" parameter):

W0918 20:24:54.204733     1 _caffe.cpp:125] Net('/opt/caffe/python/../models/bvlc_reference_caffenet/deploy.prototxt', 1, weights='/opt/caffe/python/../models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel')

Traceback (most recent call last):

  File "/opt/caffe/python/classify.py", line 138, in <module>

    main(sys.argv)

  File "/opt/caffe/python/classify.py", line 110, in main

    channel_swap=channel_swap)

  File "/opt/caffe/python/caffe/classifier.py", line 26, in __init__

    caffe.Net.__init__(self, model_file, pretrained_file, caffe.TEST)

RuntimeError: Could not open file /opt/caffe/python/../models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel



How am I supposed to run classify.py, and get output like : 
[('kit fox', '0.27215'), ('red fox', '0.19984'), ('wood rabbit', '0.13209'), ('hare', '0.07283'), ('Egyptian cat', '0.06632')]


And secondly, I want to be in a position where I can start training an instance of caffe with my own data. 


Reply all
Reply to author
Forward
0 new messages