InternalError: Failed to create session.錯誤及解決方式

  • 前言
  • 錯誤訊息
  • 解決方法

前言

這個錯誤是在一開始訓練Keras(使用TensorFlow當backend)模型的時候就出現。
Python版本:3.5.2
Keras版本:2.1.3
TensorFlow版本:1.9.0

錯誤訊息

InternalErrorTraceback (most recent call last)
<ipython-input-4-d4cc2ca313a3> in <module>
10 model.compile(loss=‘mse’, optimizer=‘adam’)
11 # fit network
—> 12 history = model.fit(X_train, y_train, epochs=3000, batch_size=16, validation_data=(x_test, y_test), verbose=2, shuffle=False)
13 #history = model.fit(X,y, epochs=3000, batch_size=16, verbose=2, shuffle=False)
14 # plot history
/usr/local/lib/python3.5/dist-packages/keras/models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
963 initial_epoch=initial_epoch,
964 steps_per_epoch=steps_per_epoch,
–> 965 validation_steps=validation_steps)
966
967 def evaluate(self, x=None, y=None,
/usr/local/lib/python3.5/dist-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1667 initial_epoch=initial_epoch,
1668 steps_per_epoch=steps_per_epoch,
-> 1669 validation_steps=validation_steps)
1670
1671 def evaluate(self, x=None, y=None,
/usr/local/lib/python3.5/dist-packages/keras/engine/training.py in _fit_loop(self, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)
1204 ins_batch[i] = ins_batch[i].toarray()
1205
-> 1206 outs = f(ins_batch)
1207 if not isinstance(outs, list):
1208 outs = [outs]
/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py in call(self, inputs)
2471 feed_dict[tensor] = value
2472 fetches = self.outputs + [self.updates_op] + self.fetches
-> 2473 session = get_session()
2474 updated = session.run(fetches=fetches, feed_dict=feed_dict,
2475 **self.session_kwargs)
/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py in get_session()
174 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
175 allow_soft_placement=True)
–> 176 _SESSION = tf.Session(config=config)
177 session = _SESSION
178 if not _MANUAL_VAR_INIT:
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in init(self, target, graph, config)
1561
1562 “”"
-> 1563 super(Session, self).init(target, graph, config=config)
1564 # NOTE(mrry): Create these on first __enter__ to avoid a reference cycle.
1565 self._default_graph_context_manager = None
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in init(self, target, graph, config)
631 if self._created_with_new_api:
632 # pylint: disable=protected-access
–> 633 self._session = tf_session.TF_NewSession(self._graph._c_graph, opts)
634 # pylint: enable=protected-access
635 else:
InternalError: Failed to create session.

解決方法

到命令行使用nvidia-smi查看GPU memory的使用情況:

發現GPU memory己被其它的程序佔滿。
試著將這些程序關掉,然後再重新運行剛剛那段代碼(不必重啟kernel),發現問題成功解決!

InternalError: Failed to create session.錯誤及解決方式相关推荐

  1. docker-compose up:ERROR: Encountered errors while bringing up the project.錯誤及解決方式

    docker-compose up:ERROR: Encountered errors while bringing up the project.錯誤及解決方式 前言 發生原因 錯誤訊息 解決方式 ...

  2. CentOS下安裝Nvidia docker 2.0:[Errno 256] No more mirrors to try錯誤及解決方式

    CentOS下安裝Nvidia docker 2.0:[Errno 256] No more mirrors to try. [Errno 14] HTTPS Error 404 - Not Foun ...

  3. Tensorflow 报错:tensorflow.python.framework.errors_impl.InternalError: Failed to create session....

    问题描述 IDE:pycharm,环境中安装tensorflow-gpu 1.8.0 ,Cuda9 ,cudnn 7,等,运行代码 报错如下 tensorflow.python.framework.e ...

  4. tensorflow.python.framework.errors_impl.InternalError: Failed to create session.

    简介 首先说一下我出现的情况,使用gpu运行跑模型的时候.出现标题的情况.然后查看显卡(命令:nvidia-smi)中进程的使用情况的时候,出现一个python进程正在运行,所以导致无法failed ...

  5. php libiconv close_PHP 編譯安裝時出現 undefined reference to `libiconv' 錯誤的解決方法

    原文:http://flyfishes.blog.51cto.com/3527694/819693 手動編譯PHP安裝時遇到如下錯誤 /usr/local/src/php-5.3.10/ext/xml ...

  6. Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server 錯誤的解決辦法

    只要重寫VerifyRenderingInServerForm() public override void VerifyRenderingInServerForm(Control ct) { }

  7. linux grub error 22,Linux系統grub常見錯誤問題解決

    Linux在現在已經很強大了,導致Linux系統越來越受到電腦用戶的歡迎,於是很多人開始學習Linux時,學習時你可能會遇到Linux系統grub常見錯誤問題,這裡將介紹Linux系統grub常見錯誤 ...

  8. linux ora-00031,kill session遇到ORA-00031錯誤

    今天在處理一個表被鎖死的問題時,遇到ORA-00031: 這個階段作業將被標示為要終結的階段作業 具體操作步驟如下: 1. 先確認鎖定資源的session信息 select OS_USER_NAME, ...

  9. android dex2oatd e,解決android項目Error:Execution failed for task ':app:dexDebug'.ebug'錯誤

    先上錯誤信息:Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessEx ...

最新文章

  1. u盘文件看得见却打不开_【U盘】国产开源U盘启动制作工具
  2. 2020年第十一届蓝桥杯 - 省赛 - Python大学组 - D.蛇形填数
  3. 现代CIO的关键是需要建立 IT/OT之间的桥梁
  4. ConcurrentHashMap--自用,非教学
  5. Redis和数据库 数据同步问题
  6. CSU 1203 Super-increasing sequence
  7. Spring Swagger URL传参问题(转)
  8. caffe win 还是 linux,caffe的windows版本安装,超级简单
  9. Java 线程——Timer TimerTask
  10. java IO 笔记
  11. Unity | 安卓 读取和写入TXT文本操作
  12. 在win7上跑基于任少卿作者代码修改的RPN+BF实验
  13. 计算机科学感言,计算机专业学生毕业感言
  14. [架构之美]一款APP从想法-开发-上线-产品的全过程
  15. adobe scout cc 2015中文版下载(附使用教程)
  16. Python plotly保存图片
  17. 黑板课爬虫闯关第一关
  18. 按键状态机—实现连发
  19. Ai形状模式与路径查找器
  20. 手机记事本软件敬业签如何添加新分类

热门文章

  1. Laravel实现dingo+JWT api接口之实战篇
  2. java复制sheet_java-poi 复制Sheet到另一个excel的sheet中
  3. android新闻客户端的实现
  4. 【深度学习基础知识 - 28】三维重建中的点云、体素、mesh
  5. A. Sonya and Queries
  6. 《C#零基础入门之百识百例》(九)位和赋值运算符 -- 2的n次幂
  7. Matlab_逐步回归
  8. pytest之标记会失败的测试:pytest.mark.xfail
  9. hahaha终于注册了一个博客
  10. 个人支付收款接口现状剖析