Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

Problem:Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

Solve:

      config = tf.ConfigProto()
      config.gpu_options.allow_growth = True
      session = tf.Session(config=config)

or:

      gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=args.gpu_memory_fraction,allow_growth=True)
      sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options, log_device_placement=False))

你可能感兴趣的:(机器学习)