日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python运行提示显卡内存不足_tensorflow电脑显存不足解决办法

發布時間:2023/12/8 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python运行提示显卡内存不足_tensorflow电脑显存不足解决办法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

"C:\My File\Python\python.exe" C:/workspace/Python/deep-learning/card/程序/C識別碼.py

2019-05-09 21:42:01.200659: I C:\Users\User\Source\Repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:955] Found device 0 with properties:

name: GeForce GTX 960M

major: 5 minor: 0 memoryClockRate (GHz) 1.176

pciBusID 0000:01:00.0

Total memory: 2.00GiB

Free memory: 1.65GiB

2019-05-09 21:42:01.201008: I C:\Users\User\Source\Repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:976] DMA: 0

2019-05-09 21:42:01.201151: I C:\Users\User\Source\Repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:986] 0: Y

2019-05-09 21:42:01.201313: I C:\Users\User\Source\Repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1045] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0)

2019-05-09 21:42:10.905265: E C:\Users\User\Source\Repos\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:371] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED

2019-05-09 21:42:10.905511: E C:\Users\User\Source\Repos\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:375] error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows

2019-05-09 21:42:10.906236: E C:\Users\User\Source\Repos\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:338] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM

2019-05-09 21:42:10.906464: F C:\Users\User\Source\Repos\tensorflow\tensorflow\core\kernels\conv_ops.cc:672] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)

Process finished with exit code -1073740791 (0xC0000409)

我的電腦是960M的顯卡,跑程序會出現顯出不足的問題

那我們就在程序里面控制GPU的占用比,不讓他占滿就好了,在程序里面加上:

os.environ["CUDA_VISIBLE_DEVICES"] = '0' #指定第一塊GPU可用

config = tf.ConfigProto()

config.gpu_options.per_process_gpu_memory_fraction = 0.5 # 程序最多只能占用指定gpu50%的顯存

config.gpu_options.allow_growth = True #程序按需申請內存

sess = tf.Session(config = config)

就好了,就是會稍微慢點

總結

以上是生活随笔為你收集整理的python运行提示显卡内存不足_tensorflow电脑显存不足解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。