らんだむな記憶

blogというものを体験してみようか!的なー

Deep Learning VM の VM インスタンス作成 (2)

GCPオベンキョ(7) — Deep Learning VM の VM インスタンス作成 - らんだむな記憶 を参考にイメージを作り直し。イメージファミリーは イメージの選択  |  Deep Learning VM Image  |  Google Cloud を参考にする。

gcloud compute --project=プロジェクトID instances create ml-dev --zone=asia-northeast1-a --image-family=swift-latest-gpu-ubuntu-1804 --image-project=deeplearning-platform-release --subnet=VPCで作成したサブネット名 --network-tier=PREMIUM --no-restart-on-failure --maintenance-policy=TERMINATE --preemptible --machine-type=n1-highmem-4 --accelerator="type=nvidia-tesla-t4,count=1" --metadata="install-nvidia-driver=True" --boot-disk-size=100GB --boot-disk-device-name=ml-dev --labels=env=ml-dev

にしてみる。Swift for TensorFlow を気が向いたら使ってみたいなぁ〜という程度の動機だが。swift/Installation.md at main · tensorflow/swift · GitHub も参考になる。

既存の VM インスタンスを削除してから新しいインスタンスを作ったのだが、前回と同じパブリック IP が振られたようだ。この場合、~/.ssh/known_hosts にエントリが残っていたため、

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Please contact your system administrator.

と出て随分と悩んでしまった。~/.ssh/known_hosts からエントリを削除してリトライすれば解決した。

とりあえず TensorFlow 2.4.1 と PyTorch 1.7.1 にアップデートしよう。Python 3.8 系が無難そうだ。とりあえず Python 3.8.7 にする。
CUDA 11.0 なので以下で PyTorch をインストールする。

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html