ubuntu 使用tensorflow-gpu2.X 报错 Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

要在文件开始处添加:

config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)

原因是因为tensorflow会申请整个显卡内存,虽然它用不到,比如我是rtx2070(8g显存),他就申请8G,但是有其他程序在使用,所以失败。

猜你喜欢

转载自blog.csdn.net/qq_35674193/article/details/112003577
今日推荐