赞
踩
Colaboratory 支持 Python 2.7 和 Python 3.6。
谷歌中文说明:https://colab.research.google.com/notebook
要使用云端硬盘,首先你必须翻墙!
from google.colab import drive
drive.mount('/content/drive/')
!pwd #用 pwd 命令显示工作路径
# /content
!ls #查看的是 content 文件夹下有哪些文件
# sample_data (Google 默认生成的一个文件,这里是共有资源,要是将文件放在这个目录下,Google 会回收里面的东西,所以要尽可能避免将文件放在这一级目录中)
!ls "drive/My Drive"
# TensorFlow (这就是我们之前创建的那个文件夹)
import os
os.chdir("/content/drive/My Drive/TensorFlow")
os.getcwd()
# '/content/drive/My Drive/TensorFlow'
import tensorflow as tf
tf.test.gpu_device_name()
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
!cat /proc/meminfo
!cat /proc/cpuinfo
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。