利用Colab上的TPU训练Keras模型(完整版)
0. 前言
- Colab的建立
1.1 登录google云盘
1.2 建立colaboratory文件
1.3 运行colaboratory - Colab的配置
2.1 查看RAM与磁盘
2.2 切换服务器模式(CPU/GPU/TPU)
2.3 设置笔记本显示行号
2.4 在notebook中执行linux命令 - 文件访问
3.1 文件的上传/下载
3.2 挂载driver中的文件夹 - 设置TPU加速
4.1 初始化TPU环境
4.2 将keras模型转化为TPU模型
4.3 使用tf优化器(可选)
4.4 设定fit时的batch_size
4.5 TPU模型的保存与恢复
4.6 使用权重推理
4.7 Debug
详情查看
https://blog.csdn.net/big91987/article/details/87898100#1_Colab_10
参考文档
使用TPU免费加速Keras模型训练:
https://www.jqr.com/article/000594
Tutorial - How to train Keras model x20 times faster with TPU for free
https://colab.research.google.com/drive/1QZf1WeX3EQqBLeFeT4utFKBqq-ogG1FN#scrollTo=CB43mV-TD1vb
colab读写外部文件的四种方式:
https://blog.csdn.net/heliucs/article/details/84644372
google cloud TPU教程:
https://cloud.google.com/tpu/docs/tutorials