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?

Docker上の import tensorflow で60秒かかっていた話(解決済み)

0
Posted at

import tensorflow で60秒かかる

Windows+WSL で devcontainer上で tensorflow を使った開発をしていましたが、 import tensorflow があるスクリプトは開始まで60秒ほどかかっていました。

原因はバインドマウントでした。

  • venv を Windows のフォルダに作成 → 60秒かかる(Windowsフォルダのbind)
  • venv を /opt/.venv に作成 → 2秒(Docker の volume)

.devcontainer.json の修正箇所

  "mounts": [
    {
      "source": "tensorflow-project-storage",
      "target": "/opt/shared",
      "type": "volume"
    }
  ]

この設定を実施し、tensorflow を使用するプロジェクトで tensorflow-project-storage というmountポイントを使い回せば同じストレージを見にいきますので、再度 venv 作る必要がなくなります。

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?