failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED

问题:

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:

实验环境:

   Ubuntu16.04LTS
   tensorflow1.3版本
   pycharm2017.2
   python2.7

原因: 在创建session时没有使用想让它用的GPU


解决方法:设置 CUDA_VISIBLE_DEVICES
(1)在python中添加语句

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
#....这样就OK了

(2)运行界面添加cuda

   CUDA_VISIBLE_DEVICES=1 python experiment*****.py

(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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

@RichardWang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值