当前位置:网站首页>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
边栏推荐
- Check the example of where the initialization is when C initializes the program
- phpcms实现PC网站接入微信Native支付
- Bit operation ==c language 2
- Huffman encoded compressed file
- 为什么安装mysql时starting service报错?(操作系统-windows)
- 虚数j的物理意义
- 2016 CCPC Hangzhou Onsite
- Parameter sniffing (1/2)
- ES类和对象、原型
- 2020 Zhejiang Provincial Games
猜你喜欢
AI moves from perception to intelligent cognition
ORM--数据库增删改查操作逻辑
Introduction to energy Router: Architecture and functions for energy Internet
The new activity of "the arrival of twelve constellations and goddesses" was launched
The landing practice of ByteDance kitex in SEMA e-commerce scene
Bean operation domain and life cycle
能源路由器入门必读:面向能源互联网的架构和功能
AI从感知走向智能认知
【原创】程序员团队管理的核心是什么?
【ORM框架】
随机推荐
Scratch crawler mysql, Django, etc
PostgreSQL reports an error when creating a trigger,
Pit using BigDecimal
Integer inversion
MongoDB创建一个隐式数据库用作练习
flink. CDC sqlserver. 可以再次写入sqlserver中么 有连接器的 dem
C# Socke 服务器,客户端,UDP
How to use Mongo shake to realize bidirectional synchronization of mongodb in shake database?
Future development blueprint of agriculture and animal husbandry -- vertical agriculture + artificial meat
Detailed explanation of diffusion model
Pit encountered by vs2015 under win7 (successful)
基础篇:带你从头到尾玩转注解
How to become a senior digital IC Design Engineer (5-2) theory: ULP low power design technology (Part 1)
request对象对请求体,请求头参数的解析
Analyze Android event distribution mechanism according to popular interview questions (II) -- event conflict analysis and handling
Deadlock caused by non clustered index in SQL Server
Official media attention! The list of top 100 domestic digital collection platforms was released, and the industry accelerated the healthy development of compliance
ES类和对象、原型
根据热门面试题分析Android事件分发机制(二)---事件冲突分析处理
Parameter sniffing (1/2)