版本变化
高效的TensorFlow 2.0(tensorflow2官方教程翻译)
TensorFlow2.0 问世,Pytorch还能否撼动老大哥地位
1 环境要求
CUDA10
2 安装命令
参考:https://blog.csdn.net/u011119817/article/details/88309256
pip install tensorflow==2.0.0b1 #cpu版本
pip install tensorflow-gpu==2.0.0b1 #gpu版本
pip install tensorflow==2.0.0rc2 #cpu版本
pip install tensorflow-gpu==2.0.0rc2 #gpu版本
3 debug
#x_train is tensor
tf.print('tf.shape(x_train):',tf.shape(x_train))
tf.print('tf.shape(y_train):',tf.shape(y_train))
tf.print(x_train)
4 mult gpu
参考:https://www.jianshu.com/p/d57595dac5a9
5.两步轻松实现在Keras中使用Tensorboard
参考:https://www.lizenghai.com/archives/5135.html
tensorboard --logdir logs
6.keras保存和恢复模型
https://www.cnblogs.com/augustone/p/10507185.html
7.BatchNormalization坑
http://www.cainiaoxueyuan.com/suanfa/11644.html
8.问题:default/dso_loader.cc:53] Could not dlopen library ‘cupti64_100.dll’; dlerror: cupti64_100.dll not found
参考:https://github.com/tensorflow/tensorflow/issues/6235
解决方法:
I have encountered this problem before. When you use CUDA 8.0,the file cupti64_80.dll lies in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\CUPTI\libx64. I just fixed the problem by copying the dll into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin, and the file cupti.lib in the same location into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64. And it works!
1.复制
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\CUPTI\libx64\cupti64_80.dll
到
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\
2.复制
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\CUPTI\libx64\cupti.lib
到
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\