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 1 year has passed since last update.

DRP

Last updated at Posted at 2023-11-04

学習済みモデルを作る

ウェブ・ブラウザでTeachable Machine を使ってで学習済みモデルを作る
'Tensorflow' 'Saved model' として学習済みモデルをエキスポートする
ダウンロードされたファイルをLinux(WSL)側に移して解凍する

ONNXモデルに変換する

WSLのUbuntu上で作業

  • tf2onnx をインストール
  • tensorflow をインストール
  • tensorRT をインストール
pip install onnx==1.13.0
pip install tensorflow==2.9.0
pip install onnxruntime
pip install -U tf2onnx==1.13.0

※バージョン重要
pythonバージョンは3.8.10でやりました

解凍すると,model.savedmodelというディレクトリがある.このディレクトリを --saved-model 引数に与え,次のコマンドを実行する.
出力ファイル名は --output 引数で指定する.

python -m tf2onnx.convert --saved-model model.savedmodel --output sushi.onnx --opset 12

実行形式へ変換する

ルネサスのフレームワークを使ってONNXファイルを変換する.

環境構築

予め,DRP-AI Translator V1.83 Installer (ZIP)をダウンロードしておく.
DRP-AI Translator V1.83 User’s Manual(p.9)の3.2.1.Installation Procedureに従い,インストールをする.

$ sudo apt-get update
$ sudo apt-get install -y libgl1-mesa-dev wget libopencv-dev
$ sudo apt-get install -y python3-pip
$ pip3 install -U pip
$ chmod +x DRP-AI_Translator-v1.83-Linux-x86_64-Install
$ ./DRP-AI_Translator-v1.83-Linux-x86_64-Install

ダウンロード

  • DRP-AI Translator V1.83 Installer (ZIP)
  • DRP-AI Translator V1.83 User‘s Manual (PDF) 使い方

(1)Teachable Machine
https://teachablemachine.withgoogle.com/
(2)TensorFlow Hubから取得した機械学習モデルをONNX形式に変換する
https://zenn.dev/yuyakato/articles/226faa817ed01d

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?