Difference between revisions of "TB3 ROS OpenCL Caffe"

From wikidb
Jump to: navigation, search
(Building and Installing)
(Demo 1)
 
(20 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
* [https://github.com/intel/ros_opencl_caffe ROS OpenCL Caffe]
 
* [https://github.com/intel/ros_opencl_caffe ROS OpenCL Caffe]
 +
*
 +
* [https://pjreddie.com/darknet/yolov2/ YOLO2]
  
 
== Prerequisite ==
 
== Prerequisite ==
Line 10: Line 12:
  
 
== Environment Setup ==
 
== Environment Setup ==
 +
 +
'''Done February 2019'''
  
 
* ROS Kinetic - See [[TR3_Intel_ROS_Project#Software_Environment]]
 
* ROS Kinetic - See [[TR3_Intel_ROS_Project#Software_Environment]]
 
* Catkin Workspace - See [[TR3_Intel_ROS_Project#Software_Environment]]
 
* Catkin Workspace - See [[TR3_Intel_ROS_Project#Software_Environment]]
* clCaffe [[TB3 clCaffe]] - '''Done''' - This step is misleadingly involved. It is also finicky. It took me several trials to get it right. Once done, it doesn't appear that difficult. It is easy to miss a detail that puts you on a bad path. Furthermore, there is a lot of glue here to stitch together components from diverse environments, for example, ROS catkin, classic Ubuntu, rpm, Debian, and OpenCL.
+
* clCaffe [[TB3 clCaffe]] - '''Maybe Done February 2019''' - This step is misleadingly involved. It is also finicky. It took me several trials to get it right. Once done, it doesn't appear that difficult. It is easy to miss a detail that puts you on a bad path. Furthermore, there is a lot of glue here to stitch together components from diverse environments, for example, ROS catkin, classic Ubuntu, rpm, Debian, and OpenCL. Furthermore, its not clear how many of the support items are needed. I found I needed some of "Inference Optimization" and "YOLO2 Model Support".  
  
 
* Create a symbol link in /opt/clCaffe
 
* Create a symbol link in /opt/clCaffe
Line 19: Line 23:
 
   $ sudo ln -s /home/eepp/code/clCaffe/ /opt/clCaffe
 
   $ sudo ln -s /home/eepp/code/clCaffe/ /opt/clCaffe
  
* Add clCaffe libraries to LD_LIBRARY_PATH.
+
* Add clCaffe libraries to LD_LIBRARY_PATH to the .bashrc file.
 
   
 
   
 
   $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/clCaffe/build/lib
 
   $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/clCaffe/build/lib
Line 26: Line 30:
  
 
== Building and Installing ==
 
== Building and Installing ==
 +
 +
'''Done February 2019'''
  
 
* object_msgs has already been installed. See [[TR3_Intel_ROS_Project#Package:_Object_Msgs_.281.29]]
 
* object_msgs has already been installed. See [[TR3_Intel_ROS_Project#Package:_Object_Msgs_.281.29]]
Line 49: Line 55:
  
 
== Running Demo ==
 
== Running Demo ==
 +
 +
=== Demo 1 ===
 +
 +
'''Passed February 2019'''
  
 
   $ roslaunch opencl_caffe_launch usb_cam_viewer.launch
 
   $ roslaunch opencl_caffe_launch usb_cam_viewer.launch
  
error
+
'''Holly Shit''' it did something interesting.
 
    
 
    
<pre>
+
This didn't work until I added "Inference Optomization" and "Yolo2 Model Support" items in [[TB3_clCaffe]].
[ INFO] [1530904426.683260478]: Initializing nodelet with 8 worker threads.
+
[ INFO] [1530904426.698657854]: waitForService: Service [/opencl_caffe_manager/load_nodelet] is now available.
+
[ERROR] [1530904426.768114610]: Network configuration file or weights file not found!
+
[FATAL] [1530904426.768148591]: Load resource failed.
+
[ INFO] [1530904426.776194104]: using default calibration URL
+
[ INFO] [1530904426.776266443]: camera calibration URL: file:///home/eepp/.ros/camera_info/head_camera.yaml
+
[ INFO] [1530904426.776329829]: Unable to open camera calibration file [/home/eepp/.ros/camera_info/head_camera.yaml]
+
[ WARN] [1530904426.776355791]: Camera calibration file /home/eepp/.ros/camera_info/head_camera.yaml not found.
+
[ INFO] [1530904426.776384013]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
+
[FATAL] [1530904426.906813757]: Failed to load nodelet '/opencl_caffe_nodelet` of type `opencl_caffe/opencl_caffe_nodelet` to manager `opencl_caffe_manager'
+
[ WARN] [1530904427.124408271]: unknown control 'focus_auto'
+
  
[opencl_caffe_nodelet-2] process has died [pid 20876, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load opencl_caffe/opencl_caffe_nodelet opencl_caffe_manager /usb_cam/image_raw:=/usb_cam/image_raw inference:=/opencl_caffe/inference __name:=opencl_caffe_nodelet __log:=/home/eepp/.ros/log/62efeeda-8146-11e8-ba73-f83441c849fc/opencl_caffe_nodelet-2.log].
+
=== Demo 2 ===
log file: /home/eepp/.ros/log/62efeeda-8146-11e8-ba73-f83441c849fc/opencl_caffe_nodelet-2*.log
+
[opencl_caffe_manager-1] process has died [pid 20875, exit code -11, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=opencl_caffe_manager __log:=/home/eepp/.ros/log/62efeeda-8146-11e8-ba73-f83441c849fc/opencl_caffe_manager-1.log].
+
log file: /home/eepp/.ros/log/62efeeda-8146-11e8-ba73-f83441c849fc/opencl_caffe_manager-1*.log
+
^C[usb_cam-4] killing on exit
+
[opencl_caffe_viewer-3] killing on exit
+
shutting down processing monitor...
+
... shutting down processing monitor complete
+
done
+
</pre>
+
  
Investigation
+
'''Failed'''
 +
 
 +
  $ roslaunch opencl_caffe_launch realsense_viewer.launch
 +
 +
      File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 203, in get_path
 +
        raise ResourceNotFound(name, ros_paths=self._ros_paths)
 +
        ResourceNotFound: realsense_ros_camera
 +
 
 +
Error: realsense_ros_camera not found. It should be in realsense_samples_ros. See similar issue in [[TB3_ROS_Moving_Object#Launch_1]]
 +
 
 +
== Test ==
 +
 
 +
'''TBD'''
 +
 
 +
== Investigation ==
  
 
   $ cd /home/eepp/ros_packages/roslaunch_to_dot
 
   $ cd /home/eepp/ros_packages/roslaunch_to_dot
Line 85: Line 89:
 
   
 
   
 
   $ gimp caffe_nodelet.png
 
   $ gimp caffe_nodelet.png
 +
 +
Also did "usb_cam_viewer.launch"

Latest revision as of 12:01, 16 February 2019

Reference

Prerequisite

  • Done: Ubuntu 16.04
  • Done: ROS kinetic
  • Done: RGB Camera

Environment Setup

Done February 2019

  • ROS Kinetic - See TR3_Intel_ROS_Project#Software_Environment
  • Catkin Workspace - See TR3_Intel_ROS_Project#Software_Environment
  • clCaffe TB3 clCaffe - Maybe Done February 2019 - This step is misleadingly involved. It is also finicky. It took me several trials to get it right. Once done, it doesn't appear that difficult. It is easy to miss a detail that puts you on a bad path. Furthermore, there is a lot of glue here to stitch together components from diverse environments, for example, ROS catkin, classic Ubuntu, rpm, Debian, and OpenCL. Furthermore, its not clear how many of the support items are needed. I found I needed some of "Inference Optimization" and "YOLO2 Model Support".
  • Create a symbol link in /opt/clCaffe
 $ sudo ln -s /home/eepp/code/clCaffe/ /opt/clCaffe
  • Add clCaffe libraries to LD_LIBRARY_PATH to the .bashrc file.
 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/clCaffe/build/lib

Building and Installing

Done February 2019

 $ cd ~/catkin_ws/src/

 $ git clone https://github.com/intel/ros_opencl_caffe

 $ cd ~/catkin_ws/

 $ catkin_make
     ...
     [ 98%] Linking CXX executable /home/eepp/catkin_ws/devel/lib/opencl_caffe/unittest_detector
     [ 98%] Built target unittest_detector
     [100%] Linking CXX executable /home/eepp/catkin_ws/devel/lib/movidius_ncs_stream/unittest_stream_detection
     [100%] Built target unittest_stream_detection

 $ catkin_make install

 $ source install/setup.bash

 $ cp ~/catkin_ws/src/ros_opencl_caffe/opencl_caffe/resources/voc.txt /opt/clCaffe/data/yolo/

Running Demo

Demo 1

Passed February 2019

 $ roslaunch opencl_caffe_launch usb_cam_viewer.launch

Holly Shit it did something interesting.

This didn't work until I added "Inference Optomization" and "Yolo2 Model Support" items in TB3_clCaffe.

Demo 2

Failed

 $ roslaunch opencl_caffe_launch realsense_viewer.launch

     File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 203, in get_path
       raise ResourceNotFound(name, ros_paths=self._ros_paths)
       ResourceNotFound: realsense_ros_camera

Error: realsense_ros_camera not found. It should be in realsense_samples_ros. See similar issue in TB3_ROS_Moving_Object#Launch_1

Test

TBD

Investigation

 $ cd /home/eepp/ros_packages/roslaunch_to_dot

 $ python roslaunch-to-dot.py --png ~/catkin_ws/install/share/opencl_caffe_launch/launch/opencl_caffe_nodelet.launch caffe_nodelet.dot

 $ gimp caffe_nodelet.png

Also did "usb_cam_viewer.launch"