TensorFlow MirroredStrategy示例
使用MNIST的MirroredStrategy示例。
设置
virtualenv env
source env/bin/activate
pip install tensorflow
镜像策略介绍
MirroredStrategy通过启用train_distribute在争论tf.estimator.RunConfig 。
distribution = tf . contrib . distribute . MirroredStrategy ()
config = tf . estimator . RunConfig (
train_distribute = distribution ,
model_dir = "/tmp/mnist_convnet_model" )
mnist_classifier = tf .
2022-04-26 15:04:03
4KB
Python
1