原
failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
<div class="article-info-box">
<div class="article-bar-top d-flex">
<span class="time">2018年05月31日 09:55:10</span>
<div class="float-right">
<span class="read-count">阅读数:104</span>
</div>
</div>
</div>
<article>
<div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post">
<div class="markdown_views">
<p>问题:</p>
2018-05-31 09:42:41.796259: E tensorflow/stream_executor/cuda/cuda_blas.cc:366] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2018-05-31 09:42:41.796310: W tensorflow/stream_executor/stream.cc:1756] attempting to perform BLAS operation using StreamExecutor without BLAS support
2018-05-31 09:42:41.797860: E tensorflow/stream_executor/cuda/cuda_blas.cc:366] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2018-05-31 09:42:41.797887: W tensorflow/stream_executor/stream.cc:1756] attempting to perform BLAS operation using StreamExecutor without BLAS support
2018-05-31 09:42:41.798648: E tensorflow/stream_executor/cuda/cuda_blas.cc:366] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2018-05-31 09:42:41.798673: W tensorflow/stream_executor/stream.cc:1756] attempting to perform BLAS operation using StreamExecutor without BLAS support
Exception in thread Thread-2:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
实验环境:
Ubuntu16.04LTS
tensorflow1.3版本
pycharm2017.2
python2.7
- 1
- 2
- 3
- 4
原因: 在创建session时没有使用想让它用的GPU
解决方法:设置 CUDA_VISIBLE_DEVICES
(1)在python中添加语句
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
#....这样就OK了
- 1
- 2
- 3
(2)运行界面添加cuda
CUDA_VISIBLE_DEVICES=1 python experiment*****.py
- 1
(3)export的方法我没有尝试,应该也可以
参考
[1].https://stackoverflow.com/questions/37893755/tensorflow-set-cuda-visible-devices-within-jupyter
[2].https://stackoverflow.com/questions/44375177/tensorflow-unusual-cuda-related-error
</article>
<div class="article-bar-bottom">
<div class="article-copyright">
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/gsww404/article/details/80519725 </div>
<div class="tags-box artic-tag-box">
<span class="label">文章标签:</span>
<a class="tag-link" href="http://so.csdn.net/so/search/s.do?q=failed to create cublas handle&t=blog" target="_blank">failed to create cublas handle </a><a class="tag-link" href="http://so.csdn.net/so/search/s.do?q= attempting to perform BLAS op&t=blog" target="_blank"> attempting to perform BLAS op </a>
</div>
<div class="tags-box">
<span class="label">个人分类:</span>
<a class="tag-link" href="https://blog.csdn.net/gsww404/article/category/7192906" target="_blank">Tensorflow </a>
</div>
<div class="tags-box hot-word">
<span class="label">相关热词:</span>
<a class="tag-link" href="https://blog.csdn.net/menghuanbeike/article/details/74586947" target="_blank">
请求failed </a>
<a class="tag-link" href="https://blog.csdn.net/qq_36281716/article/details/52711285" target="_blank">
failed函数 </a>
<a class="tag-link" href="https://blog.csdn.net/lostspeed/article/details/12769827" target="_blank">
failed宏 </a>
</div>
</div>
<!-- !empty($pre_next_article[0]) -->
<div class="related-article related-article-prev text-truncate">
<a href="https://blog.csdn.net/gsww404/article/details/80507704">
<span>上一篇</span>TensorFlow: InternalError: Blas SGEMM launch failed </a>
</div>
<div class="related-article related-article-next text-truncate">
<a href="https://blog.csdn.net/gsww404/article/details/80533073">
<span>下一篇</span>深入探讨 神经网络参数、超参数调节 </a>
</div>
</div>