【发布时间】:2019-02-19 12:41:36
【问题描述】:
我想在我的多 GPU 系统上使用 tf.contrib.distribute.MirroredStrategy(),但它不使用 GPU 进行训练(请参阅下面的输出)。我也在运行 tensorflow-gpu 1.12。
我确实尝试直接在 MirroredStrategy 中指定 GPU,但出现了同样的问题。
model = models.Model(inputs=input, outputs=y_output)
optimizer = tf.train.AdamOptimizer(LEARNING_RATE)
model.compile(loss=lossFunc, optimizer=optimizer)
NUM_GPUS = 2
strategy = tf.contrib.distribute.MirroredStrategy(num_gpus=NUM_GPUS)
config = tf.estimator.RunConfig(train_distribute=strategy)
estimator = tf.keras.estimator.model_to_estimator(model,
config=config)
这些是我得到的结果:
INFO:tensorflow:Device is available but not used by distribute strategy: /device:CPU:0
INFO:tensorflow:Device is available but not used by distribute strategy: /device:GPU:0
INFO:tensorflow:Device is available but not used by distribute strategy: /device:GPU:1
WARNING:tensorflow:Not all devices in DistributionStrategy are visible to TensorFlow session.
预期的结果显然是在多 GPU 系统上运行训练。这些是已知问题吗?
【问题讨论】:
标签: tensorflow tensorflow-estimator