美文网首页
googole colab Tutorial

googole colab Tutorial

作者: 飘涯 | 来源:发表于2021-05-30 18:39 被阅读0次

为什么使用colab

1.云端使用,打开即用

2.关联google云端硬盘

3.免费GPU资源。

4.容易分享你的代码,配合教学,学习很方便

例子1::下载图片到你的云端硬盘

from google.colab import drive # Import a library named google.colab
drive.mount('/content/drive', force_remount=True)

%cd /content/drive/MyDrive 
#change directory to google drive
!mkdir My #make a directory named My
%cd ./My
#change directory to My

#下载图片到你的硬盘
!gdown --id '1duQU7xqXRsOSPYeOR0zLiSA8g_LCFzoV' --output Minori.jpg

例子2:使用GPU

import torch
torch.cuda.is_available() # is GPU available
# Outputs True if running with GPU

相关文章

网友评论

      本文标题:googole colab Tutorial

      本文链接:https://www.haomeiwen.com/subject/hbwpsltx.html