frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

raspberry pi 3+ B and live image app

Hi expert

I have installed ncsdk v1 and trying to run the live -image-classifier-picam. Unfortunately I get the error message below. Any hints?

making gendernet
(cd ../../caffe/GenderNet; make compile;)
make[1]: Entering directory '/home/pi/ncappzoo/caffe/GenderNet'
make[2]: Entering directory '/home/pi/ncappzoo/data/age_gender'
Traceback (most recent call last):
File "convert_mean.py", line 3, in
import caffe
File "/opt/movidius/caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
File "/opt/movidius/caffe/python/caffe/pycaffe.py", line 15, in
import caffe.io
File "/opt/movidius/caffe/python/caffe/io.py", line 2, in
import skimage.io
File "/usr/local/lib/python3.5/dist-packages/skimage/init.py", line 177, in
from .data import data_dir
File "/usr/local/lib/python3.5/dist-packages/skimage/data/init.py", line 15, in
from ..io import imread, use_plugin
File "/usr/local/lib/python3.5/dist-packages/skimage/io/init.py", line 7, in
from .manage_plugins import *
File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 28, in
from .collection import imread_collection_wrapper
File "/usr/local/lib/python3.5/dist-packages/skimage/io/collection.py", line 14, in
from ..external.tifffile import TiffFile
File "/usr/local/lib/python3.5/dist-packages/skimage/external/tifffile/init.py", line 1, in
from .tifffile import imsave, imread, imshow, TiffFile, TiffWriter, TiffSequence
File "/usr/local/lib/python3.5/dist-packages/skimage/external/tifffile/tifffile.py", line 293, in
from . import _tifffile
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Makefile:5: recipe for target 'all' failed
make[2]: *** [all] Error 1
make[2]: Leaving directory '/home/pi/ncappzoo/data/age_gender'
Makefile:17: recipe for target 'prereqs' failed
make[1]: *** [prereqs] Error 2
make[1]: Leaving directory '/home/pi/ncappzoo/caffe/GenderNet'
Makefile:11: recipe for target 'gendernet' failed
make: *** [gendernet] Error 2

Thanks,
sojohan

Comments

  • 10 Comments sorted by Votes Date Added
  • edited October 28 Vote Up0Vote Down

    @sojohan

    $ sudo pip3 install numpy scikit-image --upgrade
    
  • Hi Pinto
    Thanks one step further, but now I get the error below:

    mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

    /usr/lib/python3/dist-packages/scipy/_lib/_numpy_compat.py:10: DeprecationWarning: Importing from numpy.testing.nosetester is deprecated, import from numpy.testing instead.
    from numpy.testing.nosetester import import_nose
    /usr/lib/python3/dist-packages/scipy/stats/morestats.py:16: DeprecationWarning: Importing from numpy.testing.decorators is deprecated, import from numpy.testing instead.
    from numpy.testing.decorators import setastest
    /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    "Consider reducing your data sizes for best performance\033[0m")
    make[1]: Leaving directory '/home/pi/ncappzoo/caffe/AgeNet'

    Running live-image-classifier.py
    python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt
    python3: can't open file 'live-image-classifier.py': [Errno 2] No such file or directory
    Makefile:41: recipe for target 'run' failed
    make: *** [run] Error 2

    Thanks,
    sojohan

  • edited October 28 Vote Up0Vote Down

    @sojohan

    The following can be ignored.

    /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance "Consider reducing your data sizes for best performance\033[0m")
    

    live-image-classifier.py is in the following location.

    $ mkdir -p ~/workspace
    $ cd ~/workspace
    $ git clone https://github.com/movidius/ncappzoo
    $ cd ~/workspace/ncappzoo/apps/live-image-classifier/
    $ make run
    
  • Hi pinto

    The same error:

    /usr/lib/python3/dist-packages/scipy/_lib/_numpy_compat.py:10: DeprecationWarning: Importing from numpy.testing.nosetester is deprecated, import from numpy.testing instead.
    from numpy.testing.nosetester import import_nose
    /usr/lib/python3/dist-packages/scipy/stats/morestats.py:16: DeprecationWarning: Importing from numpy.testing.decorators is deprecated, import from numpy.testing instead.
    from numpy.testing.decorators import setastest
    /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    "Consider reducing your data sizes for best performance\033[0m")
    make[1]: Leaving directory '/home/pi/workspace/ncappzoo/caffe/AgeNet'

    Running live-image-classifier.py
    python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt
    python3: can't open file 'live-image-classifier.py': [Errno 2] No such file or directory
    Makefile:41: recipe for target 'run' failed
    make: *** [run] Error 2

  • edited October 28 Vote Up0Vote Down

    @sojohan

    Please move to the path where live-image-classifier.py exists and execute it.
    Python3 can not find the live-image-classifier.py file.
    Ignore the No devices found error.

    $ git clone  https://github.com/movidius/ncappzoo
    $ cd ~/ncappzoo/apps/live-image-classifier/
    $ ls -lh
    -rw-rw-r-- 1 xxxx xxxx   87 10月 29 00:17 AUTHORS.txt
    -rw-rw-r-- 1 xxxx xxxx 1.3K 10月 29 00:17 Makefile
    -rw-rw-r-- 1 xxxx xxxx 2.9K 10月 29 00:17 README.md
    -rw-rw-r-- 1 xxxx xxxx 6.2K 10月 29 00:17 live-image-classifier.py
    -rw-rw-r-- 1 xxxx xxxx  13K 10月 29 00:17 screen_shot.jpg
    
    $ make run
    making gendernet
    (cd ../../caffe/GenderNet; make compile;)
    make[1]: ディレクトリ '/home/xxxx/git/ncappzoo/caffe/GenderNet' に入ります
    make[2]: ディレクトリ '/home/xxxx/git/ncappzoo/data/age_gender' に入ります
    : 
    : 
    : 
    mvNCCompile -w age_net.caffemodel -s 12 deploy.prototxt
    /usr/local/bin/ncsdk/Controllers/Parsers/TensorFlowParser/Convolution.py:46: SyntaxWarning: assertion is always true, perhaps remove parentheses?
      assert(False, "Layer type not supported by Convolution: " + obj.type)
    /usr/local/bin/ncsdk/Controllers/Parsers/Phases.py:322: SyntaxWarning: assertion is always true, perhaps remove parentheses?
      assert(len(pred) == 1, "Slice not supported to have >1 predecessors")
    mvNCCompile v02.00, Copyright @ Intel Corporation 2017
    
    Fusing Pad and Convolution2D
    Fusing BatchNorm and Scale after Convolution
    Replacing BN with Bias&Scale
    Fusing Permute and Flatten
    Fusing Eltwise and Relu
    Eliminate layers that have been parsed as NoOp
    Evaluating input and weigths for each hw layer
    --------------------------------------
    
    
    ----------------------
    ----------------------
    # Network Input tensors ['data#20']
    # Network Output tensors ['prob#32']
    Blob generated
    make[1]: ディレクトリ '/home/xxxx/git/ncappzoo/caffe/AgeNet' から出ます
    
    Running live-image-classifier.py
    python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt
    No devices found #<--- Please ignore. `live-image-classifier.py` has been successfully called.
    
  • I get:
    totalt 36K
    -rw-r--r-- 1 pi pi 87 okt 27 16:29 AUTHORS.txt
    -rwxrwxrwx 1 pi pi 6,1K okt 27 16:29 live-image-classifier.py
    -rw-r--r-- 1 pi pi 1,3K okt 27 16:29 Makefile
    -rw-r--r-- 1 pi pi 2,9K okt 27 16:29 README.md
    -rw-r--r-- 1 pi pi 13K okt 27 16:29 screen_shot.jpg

    When I use make run, i get:
    mvNCCompile -w age_net.caffemodel -s 12 deploy.prototxt
    mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

    /usr/lib/python3/dist-packages/scipy/_lib/_numpy_compat.py:10: DeprecationWarning: Importing from numpy.testing.nosetester is deprecated, import from numpy.testing instead.
    from numpy.testing.nosetester import import_nose
    /usr/lib/python3/dist-packages/scipy/stats/morestats.py:16: DeprecationWarning: Importing from numpy.testing.decorators is deprecated, import from numpy.testing instead.
    from numpy.testing.decorators import setastest
    /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    "Consider reducing your data sizes for best performance\033[0m")
    make[1]: Leaving directory '/home/pi/workspace/ncappzoo/caffe/AgeNet'

    Running live-image-classifier.py
    python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt
    OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /home/pi/opencv-3.3.0/modules/imgproc/src/imgwarp.cpp, line 3483
    Traceback (most recent call last):
    File "live-image-classifier.py", line 189, in
    main()
    File "live-image-classifier.py", line 127, in main
    img = pre_process_image( frame )
    File "live-image-classifier.py", line 60, in pre_process_image
    img = cv2.resize( frame, tuple( ARGS.dim ) )
    cv2.error: /home/pi/opencv-3.3.0/modules/imgproc/src/imgwarp.cpp:3483: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize

    Makefile:41: recipe for target 'run' failed
    make: *** [run] Error 1

  • edited October 28 Vote Up0Vote Down

    @sojohan
    Good morning.

    Is the USB camera connected?
    It looks just as if no image was entered.
    From here on, it is not a category of NCSDK, it is a problem of control of OpenCV and USB Camera.

    camera = cv2.VideoCapture( ARGS.video )
    
    error: (-215) ssize.width > 0 && ssize.height > 0 in function resize
    

    A command to check the connection information of the USB camera.

    $ sudo ls /dev | grep video
    video0 #<- ARGS.video = 0
    video1 #<- ARGS.video = 1
    video2 #<- ARGS.video = 2
    

    Is the resolution specification of the USB camera compatible with Width = 620, Height = 480?
    If it does not correspond, adjust the following numbers according to the specifications of your USB camera.

        camera.set( cv2.CAP_PROP_FRAME_WIDTH, 620 )
        camera.set( cv2.CAP_PROP_FRAME_HEIGHT, 480 )
    

    For example,

        camera.set( cv2.CAP_PROP_FRAME_WIDTH, 800 )
        camera.set( cv2.CAP_PROP_FRAME_HEIGHT, 600 )
    
        camera.set( cv2.CAP_PROP_FRAME_WIDTH, 1024 )
        camera.set( cv2.CAP_PROP_FRAME_HEIGHT, 768 )
    
        camera.set( cv2.CAP_PROP_FRAME_WIDTH, 1600 )
        camera.set( cv2.CAP_PROP_FRAME_HEIGHT, 1200 )
    

    How is the frame rate supported?

        camera.set(cv2.CAP_PROP_FPS, 30) #<--- Add line.
        camera.set(cv2.CAP_PROP_FRAME_WIDTH, 620)
        camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
    

    Or how is the compliance status of USB 2.0 / USB 3.0?

  • Hi Pinto

    Many thanks.
    I have now got the live-image-picam experiment to work.

    When I use live-image-classifier and your 3 lines

    camera.set(cv2.CAP_PROP_FPS, 30) #<--- Add line.
    camera.set(cv2.CAP_PROP_FRAME_WIDTH, 620)
    camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)

    I get two windows the one with predictions and then the camera view that is pink......

    sojohan

  • my webcam is the cheapest Trust with resolution 640 * 480 and supports usb 2.0.

    Soren

  • Hi again

    I got a new webcam 1280*720 when I use these settings and the above commands my raspberry begins to reboot? Just before the reboot I do see a black ncs inference window....

    Sojohan

Sign In or Register to comment.