当前位置:网站首页>Google colab loads Google drive (Google drive is used in Google colab)
Google colab loads Google drive (Google drive is used in Google colab)
2022-07-07 10:07:00 【iioSnail】
List of articles
Why are you in Google Colab Use in Google Drive
Generally, there are several reasons :
- Upload slow : Upload local files to Google Colab Medium too slow , If session Out of date , You may have to upload it again and again . But if you send the file to Google Drive On , So you can start directly from Google Drive Take it up , Just upload it once .
- Data loss :Google Colab Sessions tend to expire , Resulting in the loss of model and training data , Therefore, data and models can be saved to Google Drive in , So you won't be afraid to lose , And it is very convenient for follow-up training .
- Some public datasets are Google Drive link , You can easily load them .
load Google Drive
As we enter Colab After the page , Click on the file , Then click load Google Colab:
After that, a piece of code may be generated ( It may not generate , Directly load successfully ):
from google.colab import drive
drive.mount('/content/drive')
Then run the code ( A box will pop up for confirmation for the first time ), Then you will find that there is one more file list drive Folder , Here's you Google Drive File contents of :
Then your operations on this folder will be synchronized to your Google Drive in .
from Google Drive Download files from
Loaded Google Drive after , Just use the files inside , for example :
!unzip drive/MyDrive/Datasets/wider_yolo.zip
I decompress my Google Drive in Datasets/wider_yolo.zip
file .
Write file to Google Drive
Loaded Google Drive after , Just write the file to drive/MyDrive
Under the following directory . for example :
with open('drive/MyDrive/test.txt', mode='w') as f:
f.write("Deep Learning")
After executing the above order ,MyDrive
Generated in directory test.txt
file .
Go now Google Drive You can also see the file in .
Google Colab download Google Drive Shared files
for example , There is such a shared file link :
https://drive.google.com/file/d/1xmkOQ1p6R2T44yZw55wNivPATAieyja9/view?usp=sharing
Then take out. /d/
and /view/
Between the documents id:1xmkOQ1p6R2T44yZw55wNivPATAieyja9
Then execute the following command :
!gdown --id '1xmkOQ1p6R2T44yZw55wNivPATAieyja9' --output test.txt
边栏推荐
- Database multi table Association query problem
- Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
- C# XML的应用
- Internship log - day04
- phpcms实现PC网站接入微信Native支付
- 反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
- Applet sliding, clicking and switching simple UI
- Scratch crawler mysql, Django, etc
- arcgis操作:dwg数据转为shp数据
- 农牧业未来发展蓝图--垂直农业+人造肉
猜你喜欢
Internship log - day07
CentOS installs JDK1.8 and mysql5 and 8 (the same command 58 in the second installation mode is common, opening access rights and changing passwords)
Arcgis操作: 批量修改属性表
Garbage disposal method based on the separation of smart city and storage and living digital home mode
【ORM框架】
Sqlplus garbled code problem, find the solution
China's first electronic audio category "Yamano electronic audio" digital collection is on sale!
ORM--数据库增删改查操作逻辑
Bean 作⽤域和⽣命周期
The Himalaya web version will pop up after each pause. It is recommended to download the client solution
随机推荐
ORM--分组查询,聚合查询,查询集QuerySet对象特性
2020浙江省赛
CDZSC_ 2022 winter vacation personal training match level 21 (1)
中国首款电音音频类“山野电音”数藏发售来了!
Internship log - day07
web3.0系列之分布式存储IPFS
Parameter sniffing (1/2)
2016 CCPC Hangzhou Onsite
大佬们,请问 MySQL-CDC 有什么办法将 upsert 消息转换为 append only 消
企业实战|复杂业务关系下的银行业运维指标体系建设
【学习笔记-李宏毅】GAN(生成对抗网络)全系列(一)
为什么安装mysql时starting service报错?(操作系统-windows)
Postman tutorial - scripting
Gym - 102219j kitchen plates (violent or topological sequence)
Three years after graduation
flink. CDC sqlserver. You can write the DEM without connector in sqlserver again
HCIP 第一天 笔记整理
Web3.0 series distributed storage IPFs
根据热门面试题分析Android事件分发机制(二)---事件冲突分析处理
Hcip first day notes sorting