0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Jetson NanoでTensorRTのメモ

Last updated at Posted at 2019-08-18

####リポジトリのclone

$ git clone https://github.com/tensorflow/models

####Protocol Bufferをインストール

cd ./models/research
wget -O protobuf.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protoc-3.7.0-linux-aarch_64.zip
unzip protobuf.zip
./bin/protoc object_detection/protos/*.proto --python_out=.

####テスト

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
python3 object_detection/builders/model_builder_test.py

####モデルのダウンロード

cd
git clone https://github.com/karaage0703/object_detection_tools
~/object_detection_tools/models
./get_ssd_mobilenet_v1_coco_model.sh

####TensorRT

cd
git clone https://github.com/NVIDIA-AI-IOT/tf_trt_models
cd tf_trt_models

####convert

cp ../object_detection_tools/scripts/convert_rt_model.py .
python3 convert_rt_model.py -c='../models/research/object_detection/samples/configs/ssd_mobilenet_v1_coco.config' -m='../object_detection_tools/models/ssd_mobilenet_v1_coco_2018_01_28/model.ckpt' -o='./frozen_inference_graph_trt.pb'

python3 convert_rt_model.py -c='../models/research/object_detection/samples/configs/ssd_inception_v2_coco.config' -m='../object_detection_tools/models/ssd_inception_v2_coco_2018_01_28/model.ckpt' -o='./frozen_inference_graph_trt.pb'

####importの追加

object_detection.py
import tensorflow as tf
import tensorflow.contrib.tensorrt as trt # <-- add

####物体検出

cd ./object_detection_tools
python3 scripts/object_detection.py -l='models/coco-labels-paper.txt' -m='../tf_trt_models/frozen_inference_graph_trt.pb' -d='jetson_nano_raspi_cam'

####お世話になった情報
https://qiita.com/karaage0703/items/67050f2418aa6bb3851a

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?