当我运行jupyter笔记本时,我收到此消息“内核已经死亡,自动重启失败。内核无法重启。如果你无法重启内核,你仍然可以要保存笔记本,但在重新打开笔记本之前,运行代码将不再有效。“
http://localhost:8888/?token=bc7dc2e3b31daedf0c88a9dc766aa8e74e7d03aba7934770
[I 16:13:18.114 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 16:13:24.226 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20171117161317 (::1) 13.01ms referer
=http://localhost:8888/notebooks/TensorFlow-Book-master/ch02_basics/Concept01_defining_tensors.ipynb
Could not import runpy module
Traceback (most recent call last):
File "c:\users\bdu\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <module>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\bdu\appdata\local\programs\python\python36\lib\importlib\__init__.py", line 57, in <module>
import types
File "C:\Users\BDU\Enivronments\TensorFlow-Book-master\ch02_basics\types.py", line 3, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[I 16:13:24.594 NotebookApp] Kernel started: 8b5449c6-2f01-4546-9ceb-1f036b9443e5
[I 16:13:27.535 NotebookApp] KernelRestarter: restarting kernel (1/5)
Could not import runpy module
Traceback (most recent call last):
File "c:\users\bdu\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <module>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\bdu\appdata\local\programs\python\python36\lib\importlib\__init__.py", line 57, in <module>
import types
File "C:\Users\BDU\Enivronments\TensorFlow-Book-master\ch02_basics\types.py", line 3, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[I 16:13:30.541 NotebookApp] KernelRestarter: restarting kernel (2/5)
Could not import runpy module
Traceback (most recent call last):
File "c:\users\bdu\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <module>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\bdu\appdata\local\programs\python\python36\lib\importlib\__init__.py", line 57, in <module>
import types
File "C:\Users\BDU\Enivronments\TensorFlow-Book-master\ch02_basics\types.py", line 3, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[I 16:13:33.542 NotebookApp] KernelRestarter: restarting kernel (3/5)
Could not import runpy module
Traceback (most recent call last):
File "c:\users\bdu\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <module>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\bdu\appdata\local\programs\python\python36\lib\importlib\__init__.py", line 57, in <module>
import types
File "C:\Users\BDU\Enivronments\TensorFlow-Book-master\ch02_basics\types.py", line 3, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[W 16:13:34.667 NotebookApp] Timeout waiting for kernel_info reply from 8b5449c6-2f01-4546-9ceb-1f036b9443e5
[I 16:13:36.562 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel 8b5449c6-2f01-4546-9ceb-1f036b9443e5 restarted
Could not import runpy module
Traceback (most recent call last):
File "c:\users\bdu\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <module>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\bdu\appdata\local\programs\python\python36\lib\importlib\__init__.py", line 57, in <module>
import types
File "C:\Users\BDU\Enivronments\TensorFlow-Book-master\ch02_basics\types.py", line 3, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[W 16:13:39.592 NotebookApp] KernelRestarter: restart failed
[W 16:13:39.592 NotebookApp] Kernel 8b5449c6-2f01-4546-9ceb-1f036b9443e5 died, removing from map.
ERROR:root:kernel 8b5449c6-2f01-4546-9ceb-1f036b9443e5 restarted failed!
[W 16:13:39.629 NotebookApp] 410 DELETE /api/sessions/d1b11c7a-e718-4f3e-aaf4-ebd6b66e10ec (::1): Kernel deleted before se
ssion
[W 16:13:39.630 NotebookApp] Kernel deleted before session
[W 16:13:39.631 NotebookApp] 410 DELETE /api/sessions/d1b11c7a-e718-4f3e-aaf4-ebd6b66e10ec (::1) 3.00ms referer=http://loc
alhost:8888/notebooks/TensorFlow-Book-master/ch02_basics/Concept01_defining_tensors.ipynb
请帮我解决
此致 LOKESH
答案 0 :(得分:1)
据我所知,您未能导入tensorflow:
导入tensorflow为tf ModuleNotFoundError:没有名为的模块 &#39; tensorflow&#39;
所以你应该先修复它并安装它。