2016-06-07 86 views
0

当我使用多GPU的负载是由单一的训练模式,我得到这个错误信息:我们可以使用多gpu traing来恢复由单个gpu训练的模型吗?

张量名称“test_mutli_gpu_1/test_mutli_gpu_1 /平均值/平均”不是在检查点文件中找到models_0606/my_modle-50

这里是我关于图码伪:

with tf.Graph().as_default(): 
    a = tf.get_variable() 
for gpu_index in range(0,4): 
    with tf.device('/gpu:%d' % gpu_index): 
    with tf.name_scope('%s_%d' % ('test_mutli_gpu', gpu_index)) as scope: 
     tf.get_variable_scope().reuse_variables() 
     loss = caculateloss() 
     grad = calculategard() 
     grads.append(grad) 
grad = average_gradients(grads) 
apply_gradient_op = opt.apply_gradients(grads) 
variable_averages = tf.train.ExponentialMovingAverage(MOVING_AVERAGE_DECAY) 
variables_averages_op = variable_averages.apply(tf.trainable_variables()) 
train_op = tf.group(apply_gradient_op, variables_averages_op) 

有人知道我是否摆乌龙多GPU训练 非常感谢〜

+0

能否请您添加使用加载从检查点图中的一些代码测试? – nessuno

+0

它只是一个简单的代码:saver.restore(sess,“models_0606/my_modle-650”) –

回答

0

我找到了答案,通常会说如果您使用单GPU来训练模型,则无法继续使用多GPU GPU来训练您的模型。

loss_averages = tf.train.ExponentialMovingAverage(0.9,名称= '损失') loss_averages_op = loss_averages.apply(损失+ [total_loss])

在我caculateloss

()函数中,该操作会产生大约有女士prename变量您gpu_idx 要么你可以做有关cifair_multi_train.py

相关问题