InternalError (see above for traceback): Blas GEMM launch failed


訓練BiLSTM模型的時候報錯:

InternalError (see above for traceback): Blas GEMM launch failed : a.shape=(32, 200), b.shape=(200, 400), m=32, n=400, k=200
[[node bilstm_crf/bidirectional_rnn/fw/fw/while/lstm_cell/MatMul (defined at train-nxf.py:48) ]]
[[node bilstm_crf/rnn_2/while/Switch_2 (defined at train-nxf.py:69) ]]

  

解決方法:

  如果你是使用 GPU 版 TensorFlow 的話,並且你想在顯卡高占用率的情況下訓練模型,那你要注意在初始化 Session 的時候為其分配固定數量的顯存,否則可能會在開始訓練的時候直接報錯退出: 
這時你需要用下面的方法創建 Session: 

gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.333)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) 

  

參考文獻:

【1】https://blog.csdn.net/orangefly0214/article/details/80978374


免責聲明!

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



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