Tensorflow 报错:tensorflow.python.framework.errors_impl.InternalError: Failed to create session.
- 问题描述
IDE:pycharm,环境中安装tensorflow-gpu 1.8.0 ,Cuda9 ,cudnn 7,等,运行代码 报错如下
tensorflow.python.framework.errors_impl.InternalError: Failed to create session
- 解决方案
在代码中添加gpu的配置代码
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0' #use GPU with ID=0
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.5 # maximun alloc gpu50% of MEM
config.gpu_options.allow_growth = True #allocate dynamically
来源:CSDN
原文:https://blog.csdn.net/sinat_30372583/article/details/79461468
- 拓展
tensorflow-cpu和tensorflow-gpu不能混装,这两个版本不一样,但接口一样。
gpu的配置还可在run的Configuration中设置,但是不知为啥不起作用。
Tensorflow 报错:tensorflow.python.framework.errors_impl.InternalError: Failed to create session.的更多相关文章
- 【python】python安装tensorflow报错:python No matching distribution found for tensorflow==1.12.0
python安装tensorflow报错:python No matching distribution found for tensorflow==1.12.0 python版本是3.7.2 要安装 ...
- tensorflow报错 tensorflow Resource exhausted: OOM when allocating tensor with shape
在使用tensorflow的object detection时,出现以下报错 tensorflow Resource exhausted: OOM when allocating tensor wit ...
- python下pip 安装 pyautogui报错Command "python setup.py egg_info" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pip-install-svhtepho\pygetwindow\
python装的3.6 64位,使用命令pip install pyautogui 或者pip install -U pyautogui 都失败了 报错如下: Command "python ...
- 安装 xadmin 报错: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Python\AppData\Local\Temp\pip-install-1k1byg0p\xadmin\
报错详情 安装 xadmin 组件的时候报错 不论是命令行还是 pycharm 方式都不行 分析报错 按照报错提示是说 README.rst 文件的编码问题导致. 解决报错 通过 github 下载源 ...
- pip安装报错Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e_k8hq6a/pynacl/
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e_k8hq6a/pyn ...
- impdp报错ORA-39083 ORA-02304 Object type TYPE failed to create
环境Red Hat Enterprise Linux Server release 5.8 (Tikanga)ORACLE Release 11.2.0.3.0 Production 我用expdp, ...
- ubuntu下安装pip install mysqlclient 报错 command "python setup.py egg_info" failed with error.....解决方案
我的环境: ubuntu 1604 版本, 在黑屏终端已经安装了django和virtualenv虚拟环境, 在创建了django的models后开始迁移的操作, 出现错误, 错误代码最后如题目 可以 ...
- ubuntu下pig报错ERROR 2999: Unexpected internal error. Failed to create DataStorage的解决
2019-03-04 00:10:03,998 [main] ERROR org.apache.pig.Main - ERROR 2999: Unexpected internal error. Fa ...
- keras:InternalError: Failed to create session
如题,keras出现以上错误,解决办法: 找到占用gpu的进程: nvidia-smi -q 杀死这些进程即可: xxxxx
随机推荐
- CentOS 7 zabbix添加监控服务器
CentOS 7 yum安装zabbix 设置中文界面 安装环境 CentOS 7 关闭防火墙和SElinux 在被监控端安装zabbix-agent [root@zabbix-agent ~]# ...
- Spring Cloud Gateway Ribbon 自定义负载均衡
在微服务开发中,使用Spring Cloud Gateway做为服务的网关,网关后面启动N个业务服务.但是有这样一个需求,同一个用户的操作,有时候需要保证顺序性,如果使用默认负载均衡策略,同一个用户的 ...
- IT题库9-线程池的概念和原理
在什么情况下使用线程池? 1.单个任务处理的时间比较短:2.需要处理的任务的数量大: 使用线程池的好处: 1.减少在创建和销毁线程上所花的时间以及系统资源的开销.2.如不使用线程池,有可能造成系统创建 ...
- netsh禁用启用本地连接
netsh interface set interface mi8 disablednetsh interface set interface mi8 enabled mi8是本地连接名称,需要管理员 ...
- python 之路 day5 - 常用模块
模块介绍 time &datetime模块 random os sys shutil json & picle shelve xml处理 yaml处理 configparser has ...
- laravel composer
composer config -g repo.packagist composer https://packagist.phpcomposer.com 改安装包的全局镜像网址
- Linux服务器---博客wordpress
Wordpress Wordpress是一个开源的博客平台,是搭建个人博客的首选,用户可以去wordpress中文网站寻找帮助资料 1.下载wordpress软件(https://cn.wordpre ...
- react中对于context的理解
一.context旧版的基本使用 1.context的理解 当不想在组件树中通过逐层传递props或state的方式来传递数据时,可使用context来实现跨层级的组件数据传递. 2.context的 ...
- console.log在IE浏览器中会有异常
因为在IE浏览器无此方法,故此重写 方法一: var console = console || { log: function () { return false; } }; 方法二:window.c ...
- flutter 读取sdcard权限问题相关
https://stackoverflow.com/questions/46698751/permission-denied-at-externalstoragedirectory-access-vi ...