当前位置:网站首页>网站Colab与Kaggle
网站Colab与Kaggle
2022-06-12 08:13:00 【OPTree412】
教你白嫖算力(默认你会科学上网)
1.Colab白嫖方式
1.1 注册
登录谷歌云硬盘。需要注册个Google账号。
1.2 安装Colab
点击左上角的新建,然后按照步骤来
搜索Colab,点击下载就行

然后再次点开新建,就会出现Colab了
最后在我的云端硬盘里面上传你的代码和数据就可以白嫖喽
1.3 新建ipynb文件
新建一个ipynb文件
点击这个文件,就能看到可以操作代码的界面了。

1.4 初始化代码
首先装在你的硬盘,链接你的代码和数据。
装载完成之后(继续点击左侧文件夹),会发现多了一个drive目录(drive/My Drive/Colab)
在笔记本设置选择使用GPU还是CPU,有的时候可能GPU数量不够用,需要看运气了。

另外还需要一些代码的形式来初始化
# 加载盘
from google.colab import drive
drive.mount('/content/drive')
# 指定当前的工作文件夹
import os
# 此处为google drive中的文件路径,drive为之前指定的工作根目录,要加上
os.chdir("/content/drive/你的文件名")

可以查看一下自己的配置
! uname -a # 查看系统 x86_64 GNU/Linux
! python --version # 查看python版本 Python 3.7.12
! nvcc --version # 查看cuda版本 release 11.1, V11.1.105

1.5 运行代码
很简单,就! python 你的文件路径就ok了
需要安装什么包的话也是一样!pip install 你需要的包就行
1.6 头疼问题
1.6.1 长时间挂机就掉线
首先在Colab界面打开控制台(快捷键Ctrl+Shift+I),然后复制以下代码(这段代码的功能是设置每隔60000ms也就是1min自动点击一下Colab的“连接”操作,这样就不至于长时间误操作而导致自动断开连接啦,当然这只是个例子,方法不唯一,大家也可以调整下自己的间隔时间):
function ClickConnect(){
console.log("Working");
document.querySelector("colab-toolbar-button#connect").click()
}
setInterval(ClickConnect, 60000)
把上面这段代码添加到下图所示的位置 ,然后敲一下回车键即可
2.Kaggle白嫖方式
用户每周使用GPU有一定的时间限制,30h左右。
2.1 注册
进入Kaggle官网,注册是很简单的,正常操作来就好。
2.2 新建Notebook


2.3 使用数据集
2.3.1 使用Kaggle的数据集
选择你需要的就好



2.3.2 使用自己的代码和数据集
上传代码及数据集要求压缩包上传,上传后Add进去就好了

可以在这里上传你的数据集和代码,压缩包上传
2.4 使用GPU
这里是需要科学上网,然后通过你的手机号验证之后,就可以用GPU了



2.5 后台运行
关掉网页也可以在后台运行你的代码
2.6 运行代码
写控制命令时,只需要复制路径就可以获得train.py的位置
训练结果保存的位置应该为/kaggle/working/…
2.7 数据集和代码管理

边栏推荐
- How to standardize the creation of a pytorch project
- Strvec class mobile copy
- Figure neural network makes Google maps more intelligent
- 如何理解APS系统的生产排程?
- 数据库基础——规范化、关系模式
- Leetcode notes: biweekly contest 71
- Detailed explanation of Google open source sfmlearner paper combining in-depth learning slam -unsupervised learning of depth and ego motion from video
- 企业为什么要实施MES?具体操作流程有哪些?
- Ten important properties of determinant
- Learning notes (1): live broadcast by Dr. Lu Qi - face up to challenges and grasp entrepreneurial innovation opportunities - face up to challenges and grasp entrepreneurial innovation opportunities -1
猜你喜欢

You get download the installation and use of artifact

Servlet advanced

MATLAB image processing -- image transformation correction second-order fitting

Literature reading: deep neural networks for YouTube recommendations

(p36-p39) right value and right value reference, role and use of right value reference, derivation of undetermined reference type, and transfer of right value reference

MinGW offline installation package (free, fool)

KAtex problem of vscade: parseerror: KAtex parse error: can't use function '$' in math mode at position

Bean的作用域

How to write simple music program with MATLAB

Vins technical route and code explanation
随机推荐
MYSQL中的触发器
(p36-p39) right value and right value reference, role and use of right value reference, derivation of undetermined reference type, and transfer of right value reference
工厂的生产效益,MES系统如何提供?
Talk about the four basic concepts of database system
Leetcode notes: Weekly contest 277
(p25-p26) three details of non range based for loop and range based for loop
S-msckf/msckf-vio technical route and code details online blog summary
Vision Transformer | Arxiv 2205 - TRT-ViT 面向 TensorRT 的 Vision Transformer
Vision Transformer | CVPR 2022 - Vision Transformer with Deformable Attention
MES帮助企业智能化改造,提高企业生产透明度
(P14)overrid关键字的使用
APS究竟是什么系统呢?看完文章你就知道了
Alibaba cloud deploys VMware and reports an error
Explain the basic working principle of Ethernet
Xiaomi mobile phone recording data set software operation
C语言printf输出整型格式符简单总结
Three data exchange modes: line exchange, message exchange and message packet exchange
Easyexcel exports excel tables to the browser, and exports excel through postman test [introductory case]
Leetcode notes: biweekly contest 70
El expression and JSTL