1
1

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.

google Colaboratory とgoogle Driveを連携する

Last updated at Posted at 2021-07-07

いくつか、小技

Colaboratoryからgoogle Driveを利用する。

まず最初に、図左下のファイルボタンを押して、次に「ドライブをマウント」ボタンを押す。これだけで、利用可能になる。
ファイルパスは"/content/drive/MyDrive/フォルダ名"。
image.png
その他、以下の方法でも接続できる。
from google.colab import drive
drive.mount('/content/drive')

自作のライブラリをインポートするために、google Driveにパスを通す

import os
import sys
sys.path.append("/content/drive/MyDrive/my_utl")
これでパスが通るので、自作のライブラリを読み込める。
import my_multi_model として my_multi_model.func1() と呼びだす。または
import my_multi_model as my_func として my_func.func1() として呼びだす。

wandb(Weights & Biases)を使う

あらかじめ、ユーザー登録など済ませておく。https://qiita.com/daikiclimate/items/96bd784170582651651b
Colabからでも簡単に利用可能。
!pip install wandb
最初の1回だけ認証が必要。ローカルPC等では、ホームディレクトリの.netrcに自動でキーが保存される。Colabの場合、ランタイムの起動の都度wandv.initを実行した際に、/root/.netrcにキーが追加される。認証をどうやって保持してるのか不明。

ちなみに、wandbは試行の都度モデルをwandbのサイトにアップロードするのがデフォルトなので、100Gの無料枠がすぐにいっぱいになる。コールバック関数でmy_wandb = WandbCallback(save_model=False)を指定してモデルをアップロードしない設定を利用。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?