20种小技巧,玩转Google Colab
机器学习实验室
共 4901字,需浏览 10分钟
·
2020-09-29 13:07
选自amitness.com
作者:Amit Chaudhary
机器之心编译
编辑:陈萍
转自:机器之心
Google Colab 给广大的 AI 开发者提供了免费的 GPU,你可以在上面轻松地跑 Tensorflow、Pytorch 等深度学习框架。但关于 Colab 的使用技巧你又掌握了多少呢?这篇文章将介绍 20 种 Colab 使用技巧,帮你提高使用效率。
https://github.com/fastai/course-v3/blob/master/nbs/dl1/00_notebook_tutorial.ipynb
https://colab.research.google.com/github/fastai/course-v3/blob/master/nbs/dl1/00_notebook_tutorial.ipynb
https://github.com/fastai/course-v3/blob/master/nbs/dl1/00_notebook_tutorial.ipynb
https://githubtocolab.com/fastai/course-v3/blob/master/nbs/dl1/00_notebook_tutorial.ipynb
!pip install flask-ngrok flask==0.12.2
from flask import Flask
from flask_ngrok import run_with_ngrok
app = Flask(__name__)
run_with_ngrok(app)
'/') .route(
def hello():
return 'Hello World!'
if __name__ == '__main__':
app.run()
tensorflow_version 1.x
tensorflow_version 2.x
%load_ext tensorboard
%tensorboard --logdir logs
!nvidia-smi
!cat /proc/cpuinfo
import psutil
ram_gb = psutil.virtual_memory().total / 1e9
print(ram_gb)
!bash
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/notebooks/basic_features_overview.ipynb)
%load_ext google.colab.data_table
Download Miniconda installation script!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Make it executable!chmod +x Miniconda3-latest-Linux-x86_64.sh
in silent mode!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local Start installation
in current environment Make conda packages available
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')
!conda install -y flask
!nohup bash ping.sh &
往期精彩:
喜欢您就点个在看!
评论