• tensorflow电脑显存不足解决办法


    "C:My FilePythonpython.exe" C:/workspace/Python/deep-learning/card/程序/C识别码.py
    2019-05-09 21:42:01.200659: I C:UsersUserSourceRepos ensorflow ensorflowcorecommon_runtimegpugpu_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:UsersUserSourceRepos ensorflow ensorflowcorecommon_runtimegpugpu_device.cc:976] DMA: 0
    2019-05-09 21:42:01.201151: I C:UsersUserSourceRepos ensorflow ensorflowcorecommon_runtimegpugpu_device.cc:986] 0: Y
    2019-05-09 21:42:01.201313: I C:UsersUserSourceRepos ensorflow ensorflowcorecommon_runtimegpugpu_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:UsersUserSourceRepos ensorflow ensorflowstream_executorcudacuda_dnn.cc:371] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
    2019-05-09 21:42:10.905511: E C:UsersUserSourceRepos ensorflow ensorflowstream_executorcudacuda_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:UsersUserSourceRepos ensorflow ensorflowstream_executorcudacuda_dnn.cc:338] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
    2019-05-09 21:42:10.906464: F C:UsersUserSourceRepos ensorflow ensorflowcorekernelsconv_ops.cc:672] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &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)


    就好了,就是会稍微慢点
  • 相关阅读:
    查看版本号以及如何升级
    http协商缓存VS强缓存
    「JOISC 2012」星座(凸包)
    「科技」求欧拉数单项
    「科技」在线 O(1) 逆元
    「JOISC 2017 Day 3」自然公园(交互)
    「IOI 2021」分糖果(线段树)
    「EOJ 317A」击鼓传花(类欧)
    「CF 1483E」Vabank(交互,构造)
    「NOIP 2020」微信步数(计数)
  • 原文地址:https://www.cnblogs.com/zhaochunhui/p/10841454.html
Copyright © 2020-2023  润新知