1. what is colab
Colaboratory是一个免费的Jupyter笔记本环境,无需设置,并在Cloud上运行(编写,运行和共享代码)。
就是jupyter notebook的交互环境,使用google drive做存储。
这意味着,从事数据科学相关工作的时候,我们只需要一台能投连接互联网的电脑即可。性能什么的都无所谓。
除此之外,无需任何配置、免费使用GPU、容易的分享方式都是选择colab的理由。
2. free GPU
选择GPU加速。
然后测试下:
import torch
torch.cuda.is_available() # is GPU available
# Outputs True if running with GPU
输出 true
即可。
3. 使用google drive做硬盘
from google.colab import drive # Import a library named google.colab
drive.mount('/content/drive', force_remount=True) # mount the content to the directory `/content/drive`
之后会给你一个链接,返回验证码,在交互界面输入验证码之后,colab和drive就挂载成功了。
drive目录下就是google drive中的内容。
google爸爸是真的大方。