Difference between revisions of "Hood Ubuntu TensorFlow Object Detection 20211218"

From wikidb
Jump to: navigation, search
(Resources)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Depreciated =
 +
 +
Put aside for now because other paths appeared cleaner
 +
 
= Resources =
 
= Resources =
  
* [https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html TensorFlow Object Detection]
+
* [https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/ TensorFlow Object Detection]
** Download Pre-Trained Model **
+
** Download Pre-Trained Model  
** SD MobileNet V2 FPNLite 640x640 **
+
** SD MobileNet V2 FPNLite 640x640
 +
 
 +
= Download Pre-Trained Model =
 +
 
 +
* [https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2_detection_zoo.md TensorFlow Object Detection Zoo]
 +
** SD MobileNet V2 FPNLite 640x640
 +
 
 +
= Extract =
 +
 
 +
  $ mv ~/Downloads/ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz .
 +
 +
  $ tar -xf ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz
 +
 +
  $ sudo apt install tree
 +
 +
  $ tree ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8
 +
 +
        ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8
 +
        ├── checkpoint
 +
        │   ├── checkpoint
 +
        │   ├── ckpt-0.data-00000-of-00001
 +
        │   └── ckpt-0.index
 +
        ├── pipeline.config
 +
        └── saved_model
 +
            ├── saved_model.pb
 +
            └── variables
 +
                ├── variables.data-00000-of-00001
 +
                └── variables.index
 +
 +
        3 directories, 7 files
 +
 +
  $ du -s training_demo/
 +
        30568 training_demo/
 +
 +
  $ ll ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz
 +
        -rw-rw-r-- 1 eepp eepp 20518283 Dec 28 12:40 ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz
 +
 
 +
= Configure Training Pipeline =
 +
 
 +
  $ cd training_demo/
 +
 +
  $ mkdir models
 +
 +
  $ cd models/
 +
 +
  $ cp ../pre-trained-models/ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8/pipeline.config .
 +
 +
  $ mkdir ssd_mobilenet_v2_fpnlite_640x640
 +
 +
  $ mv pipeline.config ssd_mobilenet_v2_fpnlite_640x640/
 +
 
 +
  $ tree
 +
        .
 +
        ├── models
 +
        │   └── ssd_mobilenet_v2_fpnlite_640x640
 +
        │              └── pipeline.config
 +
        └── pre-trained-models
 +
            └── ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8
 +
                ├── checkpoint
 +
                │   ├── checkpoint
 +
                │   ├── ckpt-0.data-00000-of-00001
 +
                │   └── ckpt-0.index
 +
                ├── pipeline.config
 +
                └── saved_model
 +
                    ├── saved_model.pb
 +
                    └── variables
 +
                        ├── variables.data-00000-of-00001
 +
                        └── variables.index
 +
 
 +
= Check TensorFlow Version =
 +
 
 +
<pre>
 +
eepp@hood:Pictures$ python3
 +
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
 +
[GCC 9.3.0] on linux
 +
Type "help", "copyright", "credits" or "license" for more information.
 +
>>> import tensorflow as tf
 +
2021-12-27 22:40:11.338936: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/eepp/image_ws/install/stereo_image_proc/lib:/home/eepp/image_ws/install/realsense_ros/lib:/home/eepp/image_ws/install/realsense_msgs/lib:/home/eepp/image_ws/install/realsense_camera_msgs/lib:/home/eepp/image_ws/install/image_view/lib:/home/eepp/image_ws/install/image_rotate/lib:/home/eepp/image_ws/install/image_proc/lib:/home/eepp/image_ws/install/depth_image_proc/lib:/home/eepp/turtlebot3_ws/install/turtlebot3_msgs/lib:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins:/opt/ros/foxy/opt/yaml_cpp_vendor/lib:/opt/ros/foxy/opt/rviz_ogre_vendor/lib:/opt/ros/foxy/lib/x86_64-linux-gnu:/opt/ros/foxy/lib
 +
2021-12-27 22:40:11.338979: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
 +
>>> print(tf.__version__)
 +
2.5.0
 +
 
 +
</pre>

Latest revision as of 17:01, 10 January 2022

Depreciated

Put aside for now because other paths appeared cleaner

Resources

Download Pre-Trained Model

Extract

 $ mv ~/Downloads/ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz .

 $ tar -xf ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz 

 $ sudo apt install tree

 $ tree ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8

       ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8
       ├── checkpoint
       │   ├── checkpoint
       │   ├── ckpt-0.data-00000-of-00001
       │   └── ckpt-0.index
       ├── pipeline.config
       └── saved_model
           ├── saved_model.pb
           └── variables
               ├── variables.data-00000-of-00001
               └── variables.index

       3 directories, 7 files

 $ du -s training_demo/
       30568	training_demo/

 $ ll ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz 
       -rw-rw-r-- 1 eepp eepp 20518283 Dec 28 12:40 ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8.tar.gz

Configure Training Pipeline

 $ cd training_demo/

 $ mkdir models

 $ cd models/

 $ cp ../pre-trained-models/ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8/pipeline.config .

 $ mkdir ssd_mobilenet_v2_fpnlite_640x640

 $ mv pipeline.config ssd_mobilenet_v2_fpnlite_640x640/ 
 $ tree
       .
       ├── models
       │   └── ssd_mobilenet_v2_fpnlite_640x640
       │               └── pipeline.config
       └── pre-trained-models
           └── ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8
               ├── checkpoint
               │   ├── checkpoint
               │   ├── ckpt-0.data-00000-of-00001
               │   └── ckpt-0.index
               ├── pipeline.config
               └── saved_model
                   ├── saved_model.pb
                   └── variables
                       ├── variables.data-00000-of-00001
                       └── variables.index

Check TensorFlow Version

eepp@hood:Pictures$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2021-12-27 22:40:11.338936: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/eepp/image_ws/install/stereo_image_proc/lib:/home/eepp/image_ws/install/realsense_ros/lib:/home/eepp/image_ws/install/realsense_msgs/lib:/home/eepp/image_ws/install/realsense_camera_msgs/lib:/home/eepp/image_ws/install/image_view/lib:/home/eepp/image_ws/install/image_rotate/lib:/home/eepp/image_ws/install/image_proc/lib:/home/eepp/image_ws/install/depth_image_proc/lib:/home/eepp/turtlebot3_ws/install/turtlebot3_msgs/lib:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins:/opt/ros/foxy/opt/yaml_cpp_vendor/lib:/opt/ros/foxy/opt/rviz_ogre_vendor/lib:/opt/ros/foxy/lib/x86_64-linux-gnu:/opt/ros/foxy/lib
2021-12-27 22:40:11.338979: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> print(tf.__version__)
2.5.0