gpt4 book ai didi

tensorflow 启动时间?

转载 作者:行者123 更新时间:2023-12-03 00:41:17 28 4
gpt4 key购买 nike

我一直在我大学的集群上使用 GPU 版本的 Tensorflow 0.9.0。当我提交作业时,它开始运行并输出一条消息,例如:

(表示 CUDA 找到设备的内容...)
我tensorflow/core/common_runtime/gpu/gpu_device.cc:808]创建TensorFlow设备(/gpu:0)->(设备:0,名称:GeForce GTX TITAN X,pci总线ID:0000:04:00.0)

但是在此之后,它很长一段时间都没有开始实际处理任何东西。看起来它只是卡在那里一段时间...根据记录,我使用的是 https://github.com/tensorflow/models/blob/master/inception/inception/data 格式的 Imagenet 数据。 ,并在 CPU 上创建我的所有队列等,并在 GPU 上运行所有变量/操作。

我尝试过不显式调用 CPU/GPU 分割,并允许 soft_device_placement 执行其操作,但这也会导致相同的挂起。

编辑:还应该提到,即使使用原始 .JPEG 文件(即:不使用上述处理技术),这种情况仍然会发生。所以,我不认为这有什么大问题?

还有其他人经历过这种情况吗?有没有类似的情况?

谢谢。

编辑:代码片段

AlexNet = ConvNet(G,'AlexNet',k=k,H=H,W=W,D=D)


with tf.device('/gpu:0'):
(assemble AlexNet)

train_step,cross_entropy = AlexNet.getTrainStep(LR)
acc = AlexNet.getAccuracyMetric()
AlexNet.finalizeBuild()

print('file io stuff...')
with tf.device('/cpu:0'):
image_holder = tf.placeholder(tf.float32, shape=[None, H,W,D])
label_holder = tf.placeholder(tf.int32)

if mode == 'local':
label_batch = tf.one_hot(label_holder,k)
elif mode =='sherlock':
label_batch = tf.one_hot(label_holder,k,1,0)

image_batch = tf.mul(image_holder,1)


train_dataset = ImagenetData('train')
val_dataset = ImagenetData('validation')
train_images, train_labels = image_processing.inputs(train_dataset)
val_images, val_labels = image_processing.inputs(val_dataset)

#tf.initialize_all_variables()
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess=AlexNet.session,coord=coord)

print('beginning training')


val_accs = []
losses = []

for itt in range(nitt):
print(itt)
...Training routine

最佳答案

某些机器的 Nvidia 驱动程序需要一些时间才能唤醒。在运行脚本之前运行以下命令。

sudo nvidia-persistenced --persistence-mode

关于 tensorflow 启动时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41410438/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com