当前位置:网站首页>Google lab usage notes
Google lab usage notes
2022-07-28 14:55:00 【javafalcon】
google Provided colab Provides GPU、TPU Operating environment , You can save a lot of money , In use, according to your own situation , I took a few notes for review from time to time .
1. The problem of path . For a question , Just write a ipynb The file shows that it is not conducive to the reusability of the code , I am used to writing some reusable code py file , And then in ipynb Used in documents import The command reference . stay colab In order to identify the path of the file , Follow these steps .
step1. Mount Directory . We copy the following code to a cell in , And run this cell
from google.colab import drive
drive.mount('/content/drive')
step 2. Change the directory to the folder you want to use
import os
os.chdir('drive/MyDrive/Colab/workfiles')
notes : here workfiles Your working directory , Take yours. ipynb Document and py Put the file in a directory and you can use it . File references between different directories , It hasn't been used yet , It will be supplemented later .
2. colab The problem of disconnection .colab It's easy to use , But if we run a program and then do something else , Not clicking on the page for a long time will cause colab disconnect , So our code interrupts execution , To keep the page connected , Follow these steps .
step 1. Click on Google browser “ Developer tools ”

step 2. Click in the developer tool “Concole”

step 3. Copy and paste the following code at the red horizontal line in the above figure :
function ClickConnect(){
colab.config
console.log("Connnect Clicked - Start");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
console.log("Connnect Clicked - End");
};
setInterval(ClickConnect, 60000)
After copy and paste , You can enter. . In this way, you can make the web page every 60 One click per second . But in my own experiment, I found that such frequent clicks will lead to interruption , I usually set it to 10 One click per minute , Put the last line of 60000 Change it to 600000.
Statement :
This blog is just my own study notes , Not the original . All the methods are from others' blogs. Thank you here .
Note No 2 The dots come from CSDN Blogger 「 Today is another day of hope 」 The original article of ,
Link to the original text :https://blog.csdn.net/liupeng19970119/article/details/105625334
边栏推荐
- 9、 C array explanation
- 卡方分布和伽马函数(Chi-Square Distribution)
- VTK vtkcontourwidget extracts regions of interest
- How does core data save data in SQLite
- 实时切换 Core Data 的云同步状态
- Brief introduction and use of mqtt entry level
- 17、 Solutions to duplicate names of ROS function packages and nodes
- SSH service
- 八、picker用法 下拉框选择效果
- Vtkcellpicker picking triangular patches
猜你喜欢

Many "double first-class" universities have launched the research guarantee and prediction name!

Installing redis in Linux

2022 high altitude installation, maintenance, removal of examination question bank and online simulated examination

MITK creates plug-ins and generates plug-ins

国产数据库的红利还能“吃”多久?

九、uni-popup用法 下拉框底部弹窗效果

Hcip day 10

围绕新市民金融聚焦差异化产品设计、智能技术提效及素养教育

21、 TF coordinate transformation (I): coordinate MSG message
Some problems encountered in the development of Excel VBA, solutions, and continuous updates
随机推荐
C language: mathematical method of converting decimal system into binary system
Raspberry pie foundation | summarize and record some operations in the learning process of raspberry pie
6、 C language circular statement
When Xcode writes swiftui code, it is a small trap that compiles successfully but causes the preview to crash
SSL socket cross platform solution libevent OpenSSL
How to reduce the resolution of only 3D camera but not UI camera
SSH service
Multi merchant mall system function disassembly lecture 17 - platform side order list
Force deduction solution summary 1331 array sequence number conversion
Getting started with scottplot tutorial: getting and displaying values at the mouse
Swiftui layout - size (top)
Animation mechanism of swiftui
Tensorflow GPU installation process record
Use of formdata object, VAR formdata=new formdata()
19、 ROS parameter name setting
Reptile: from introduction to imprisonment (I) -- Concept
OKR与GRAD
多线程顺序运行有几种方法?
Modify the default path of Jupiter notebook
企鹅一面:为什么不建议使用SELECT * ?