intel_NCAPPZOO_example의 정규 노트

NCS 로딩에 사용되는 그래프가 컴파일된 것을 어떻게 보는지
ai@ai-usb:~/ai_ws$ find -name graph ./ncappzoo/caffe/GoogLeNet/graph ./ncappzoo/caffe/TinyYolo/graph ./ncappzoo/caffe/SqueezeNet/graph ./ncappzoo/caffe/SSD_MobileNet/graph ./ncappzoo/caffe/GenderNet/graph ./ncappzoo/tensorflow/mobilenets/graph ./ncsdk/examples/caffe/GoogLeNet/graph ./ncsdk/examples/caffe/AlexNet/graph ./ncsdk/examples/caffe/SqueezeNet/graph ./ncsdk/examples/tensorflow/inception_v3/graph ./ncsdk/examples/tensorflow/inception_v1/graph
그래프 파일을 볼 수 있다면 NCSDK에서 제공한 컴파일러로 원시 신경 네트워크 파일eg를 컴파일했음을 의미합니다.caffemodel+.prototxt –> graph. 질문:graph 파일은 왜 사용합니까?답: NCS에 불러와서 추리하는 데 사용되며, 불러오는 방법은pythonAPI:
Step 2: Load a graph file onto the NCS device
def load_graph( device ):
    # Read the graph file into a buffer.
    with open( GRAPH_PATH, mode='rb' ) as f:
        blob = f.read()

    # Load the graph buffer into the NCS.
    graph = device.AllocateGraph( blob )

    return graph

Battery-powered-dl-engine 참조
ncappzoo의 examples를 어떻게 사용합니까
1. 데모 폴더에 들어가기
pythonAPI DEMO: /ncappzoo/apps
Caffe DEMO: /ncappzoo/caffe
TensorFlow DEMO: /ncappzoo/tensorflow
2. 디렉터리에 있는run을 실행합니다.py 파일만 있으면 됩니다.(처음 실행하는 경우 make를 실행합니다.)
모든 DEMO에 대응하는 makefile이 있습니다. make를 실행하면 네트워크에서 '대응하는' 신경 네트워크 모델을 자동으로 다운로드할 수 있으며, NCSDK 도구로 NCS 장치에 불러올 수 있는graph 파일을 컴파일할 수 있습니다.
3. 이미지-classifier를 예로 들면 다음과 같습니다.
예제 cdai 만 실행ws/ncappzoo/apps/image-classifier/ ./run.py
or 처음 cd ai 실행ws/ncappzoo/apps/image-classifier/ make ./run.py
발견된 작은 BUG:
ncappzoo나ncsdk의examples만 단독으로 실행하면 ROS의setup을 제거해야 합니다.bash 터미널을 열어야 합니다.그렇지 않으면 다음 오류가 발생합니다.
Traceback (most recent call last):
  File "./run.py", line 9, in 
    import cv2
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
  • gedit로 엽니다.bashrc 파일
  • : (ROS 관련)#source /opt/ros/kinetic/setup.bash#source ~/catkin_ws/devel/setup.bash
  • 새 터미널을 열고 이전 방법(대응 디렉터리에 들어가서run.py)을 실행하면 됩니다
  • 햇살 비추다 2018-01-25일
    AgeNet 나이 추정Demo:
    NCS 장치 cd 꽂기 ~/aiss/ncappzoo/caffe/AgeNet/makerun (처음만)./run.py
    설명: 이Demo가 실행될 때 네트워크에서 227*227의 이미지 이미지를 다운로드하여 자신의 디렉터리(~/ai ws/ncappzoo/caffe/AgeNet/image.jpg)에 저장하고run을 열 수 있습니다.py 파일 보기: 46 줄, 바로 그림을 다운로드하는 주소입니다.
    실행 결과:ai@ai-usb:~/ai_ws/ncappzoo/caffe/AgeNet$ ./run.py Device 0 Address: 1 - VID/PID 03e7:2150 Starting wait for connect with 2000ms timeout Found Address: 1 - VID/PID 03e7:2150 Found EP 0x81 : max packet size is 512 bytes Found EP 0x01 : max packet size is 512 bytes Found and opened device Performing bulk write of 865724 bytes… Successfully sent 865724 bytes of data in 89.961487 ms (9.177469 MB/s) Boot successful, device address 1 Found Address: 1 - VID/PID 03e7:f63b done Booted 1 -> VSC
    ——- predictions ——– the age range is 25-32 with confidence of 99.9% ai@ai-usb:~/ai_ws/ncappzoo/caffe/AgeNet$
    햇살 비추다 2018-01-25일

    좋은 웹페이지 즐겨찾기