1. 程式人生 > >tensorflow中GPU相關設定解決視訊記憶體不足

tensorflow中GPU相關設定解決視訊記憶體不足

1.視訊記憶體不足時報錯如下:

E tensorflow/stream_executor/cuda/cuda_dnn.cc:359] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERRORE tensorflow/stream_executor/cuda/cuda_dnn.cc:326] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
2018-03-12 10:55:56.078991: F tensorflow/core/kernels/conv_ops.cc:671] Check failed: stream->parent()->GetConvolveAlgorithms(&algorithms) Aborted (core dumped)
Process finished with exit code -1073740791 (0xC0000409)

解決如下:

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=FLAGS.gpu_memory_fraction)
config = tf.ConfigProto(log_device_placement=False,gpu_options=gpu_options)
saver = tf.train.Saver(tf.global_variables())
summary_op = tf.summary.merge_all()
init = tf.initialize_all_variables()
sess = tf.Session(config=config)