7. Is GPU Working?
To see if you are currently using the GPU in Colab, you can run
the following code in order to cross-check:
import tensorflow as tf
tf.test.gpu_device_name()
Which GPU Am I Using?
Currently, Colab only provides Tesla K80.
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
What about RAM?
!cat /proc/meminfo
What about CPU?
!cat /proc/cpuinfo
Google Colaboratory
7
9. How to Mount Google Drive in Colab
如何讓Colaboratory能存取到Google Drive檔案, 也
許是為了讀取training.data或Model檔(.h5)
9
Note:
Click the link, copy verification
code and paste it to text box.
from google.colab import drive
drive.mount("/content/gdrive")
%cd gdrive/MyDrive/BERT
! ls
! git clone https://github.com/strongio/keras-bert
%cd keras-bert
12. 在Colab 底下執行.py檔
upload mnist_cnn.py file to cnn folder which is located on
your Google Drive.
!python3 "/content/gdrive/My Drive/cnn/mnist_cnn.py"
12