Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

Error importing caffe!

Community Manager

I've searched all methods through the website and it took me almost ONE day, but it seems not work.


I checked the numpy path, upgraded it, and added the caffe path to $PYTHONPATH……


Hope some expert could help. Thx very much! Here is the compile result:



pi@raspberrypi:~/ncsexp/ncappzoo/caffe/TinyYolo $ make compile


making prototxt


Prototxt file already exists


making caffemodel


caffemodel file already exists


making compile


mvNCCompile -o graph -w tiny-yolo-v1_53000.caffemodel -s 12 tiny-yolo-v1.prototxt


mvNCCompile v02.00, Copyright @ Movidius Ltd 2016


Error importing caffe


pi@raspberrypi:~/ncsexp/ncappzoo/caffe/TinyYolo $ echo $PYTHONPATH





pi@raspberrypi:~/ncsexp/ncappzoo/caffe/TinyYolo $ python3


Python 3.5.3 (default, Sep 27 2018, 17:25:39)


[GCC 6.3.0 20170516] on linux


Type "help", "copyright", "credits" or "license" for more information.





import caffe


Traceback (most recent call last):


File "", line 1, in


File "/opt/movidius/caffe/python/caffe/", line 1, in


from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver


File "/opt/movidius/caffe/python/caffe/", line 15, in




File "/opt/movidius/caffe/python/caffe/", line 2, in




File "/usr/local/lib/python3.5/dist-packages/skimage/", line 167, in


from .util.dtype import (img_as_float32,


File "/usr/local/lib/python3.5/dist-packages/skimage/util/", line 8, in


from .arraycrop import crop


File "/usr/local/lib/python3.5/dist-packages/skimage/util/", line 8, in


from numpy.lib.arraypad import _validate_lengths


ImportError: cannot import name '_validate_lengths'




0 Kudos
1 Reply
Community Manager

Hey guys…I've solved the problem by adding two function in numpy.lib.arraypad for realizing the '_validate_lengths'. Thx!