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.

Dockerfile 中でtorch2trtを実行する方法

Posted at

想定する読者

  • NVIDIAのGPUの利用者
  • pytorchの利用者
  • dockerの利用者

こまっていたこと

  • jetsonでの高速化のためにはpytotchのモデルファイルをtensorRTのモデルファイルに変換する必要がある。
  • これをdocker run の実行後に行うのは、とてもリソースの無駄遣いになっている。

実施したいこと

1 torch2trt をDockerfile の中でインストールする.
2 torch2trt を使っているモデルの変換用のスクリプトもDockerfile の中で実行させる。

解決策

Can't install inside a docker container
に解決方法が書いてあった。
以下のファイルに追記を行う。

$ sudo vim /etc/docker/daemon.json
/etc/docker/daemon.json
{
 "default-runtime": "nvidia",
... 
}
$ sudo systemctl restart docker 

この変更を行うとtorch2trtのインストール、それを用いたモデルのtrtへの変換の両方がDockerfile に記述できるようになった。

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?