解決 conda tensorflow failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED


 

參考解決方案1:https://stackoverflow.com/questions/38303974/tensorflow-running-error-with-cublas

參考解決方案2:https://github.com/tensorflow/tensorflow/issues/9489

本人環境:

Hassee G7-CT7NK

Ubuntu 18.04.2、anaconda 4.7.11、tensorflow-gpu 1.14.0

cudatoolkit 10.0.130、cudnn 7.6.0、NVidia Driver Version 430.40

本人測試使能允許增加GPU內存后,運行正常。

一勞永逸的辦法如下:

  • 在全局使能GPU內存,根據需要增加GPU內存,代價是增加內存碎片。
  • 修改腳本:~/anaconda3/envs/xxxxx/lib/python3.7/site-packages/tensorflow/python/client/session.py
  • 找到tf.Session的基類BaseSession,修改其__init__中的代碼,在適當位置添加如下腳本,即可正常使用。

 

if config is None:
      config = context.context().config

# Grow GPU memory as needed at the cost of fragmentation.
config.gpu_options.allow_growth = True

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM