LoginSignup
1
1

More than 3 years have passed since last update.

Google Colaboratory setup まとめ

Posted at

Colaboratory 環境設定

google drive のフォルダを使用
workingDir 以外は固定値

%cd は使えなくなった (もしくは、割り当てられた環境によっては使用できない)

# mount google drive
from google.colab import drive
drive.mount('/content/gdrive')

# add path
import sys
workingDir = 'path/to/folder'
sys.path.append(f'/content/gdrive/My Drive/{workingDir}')

# change working directory
import os
os.chdir(f'/content/gdrive/My Drive/{workingDir}')
%ls

tensorflowのバージョンを固定

# 2.x
%tensorflow_version 2.x
# 1.x
%tensorflow_version 1.x

apt-get, pip 実行

!apt-get install -y tool
!pip install -r requirements.txt

使用

  • 90分おきにセッションが切れるので、都度ページリロード or 再接続を行う
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