当前位置:网站首页>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
边栏推荐
- flink. CDC sqlserver. 可以再次写入sqlserver中么 有连接器的 dem
- The landing practice of ByteDance kitex in SEMA e-commerce scene
- “十二星座女神降临”全新活动推出
- 2020 Zhejiang Provincial Games
- Performance optimization record of the company's product "yunzhujia"
- Why are social portals rarely provided in real estate o2o applications?
- Web3.0 series distributed storage IPFs
- 用flinksql的方式 写进 sr的表,发现需要删除的数据没有删除,参照文档https://do
- Enterprise practice | construction of banking operation and maintenance index system under complex business relations
- Sword finger offer II 107 Distance in matrix
猜你喜欢
随机推荐
基础篇:带你从头到尾玩转注解
Codeforces - 1324d pair of topics
CDZSC_ 2022 winter vacation personal training match level 21 (1)
There is a problem using Chinese characters in SQL. Who has encountered it? Such as value & lt; & gt;` None`
web3.0系列之分布式存储IPFS
Parameter sniffing (2/2)
2016 CCPC Hangzhou Onsite
喜马拉雅网页版每次暂停后弹窗推荐下载客户端解决办法
Win10 installation vs2015
内存==c语言1
Writing file types generated by C language
Postman tutorial - scripting
Three years after graduation
The Himalaya web version will pop up after each pause. It is recommended to download the client solution
Guys, have you ever encountered the case of losing data when Flink CDC reads mysqlbinlog? Every time the task restarts, there is a probability of losing data
Sqlplus garbled code problem, find the solution
Deep understanding of UDP, TCP
Analyze Android event distribution mechanism according to popular interview questions (I)
Applet sliding, clicking and switching simple UI
AI moves from perception to intelligent cognition