- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在关注这个 tensorflow 教程 https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#protobuf-installation-compilation我在测试安装时遇到一些问题。
我在教程中安装了除 COCO API 之外的所有内容,并且现在正在 jupyter 中运行对象检测演示。由于某种原因,我在笔记本内收到一个错误,告诉我“没有名为‘tensorflow’的模块”。我仍然可以单击“全部运行”还是必须修复此错误?
谢谢! :)
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
# This is needed since the notebook is stored in the object_detection folder.
sys.path.append("..")
from object_detection.utils import ops as utils_ops
if StrictVersion(tf.__version__) < StrictVersion('1.12.0'):
raise ImportError('Please upgrade your TensorFlow installation to v1.12.*.')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-34f5cdda911a> in <module>
4 import sys
5 import tarfile
----> 6 import tensorflow as tf
7 import zipfile
8
ModuleNotFoundError: No module named 'tensorflow'
好的,由于某些原因,我现在收到此错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-34f5cdda911a> in <module>
10 from collections import defaultdict
11 from io import StringIO
---> 12 from matplotlib import pyplot as plt
13 from PIL import Image
14
ModuleNotFoundError: No module named 'matplotlib'
最佳答案
您可能面临计算机上安装了双版本 Python 的问题。 Jupyter 正在尝试编译 Tensorflow 教程文件,但使用了错误的内核(应该是 Python 3)。当我尝试运行包含 Tensorflow 的 ipynb 文件时,也发生了同样的情况。
所以我首先建议您执行以下操作:
在命令行中检查此命令的输出:
jupyter 内核规范列表
然后它应该输出类似这样的内容:(如果是 Windows 操作系统)
python3 c:\python 3.6.8\share\jupyter\kernels\python3
如果您发现“python2”或任何其他类型的版本,您应该手动删除它或尝试使用以下命令:
jupyter kernelspec 删除 python_wrong_version
最后,如果问题仍然存在,您还可以检查链接https://github.com/jupyter/notebook/issues/397以便进一步讨论。
关于python - 为什么jupyter的对象检测演示显示它无法导入tensorflow?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56860432/
在尝试安装 jupyter 的许多不同方法之后,它似乎没有正确安装。 根据我最近遇到的 MacOS 系统 python 问题,可能与 MacOS 相关 pip install jupyter --us
命名 Jupyter Notebook 时,如果使用空格,即 This is my notebook.ipynb 然后,当使用网络浏览器打开时,它的渲染效果非常好。然而,空格在命令行环境中是有害的。但
运行 jupyter notebook和 jupyter server给我非常相似的结果,描述也非常相似。 ❯ jupyter notebook -h The Jupyter HTML Noteboo
是否可以在 Jupyter Lab 中使用笔记本扩展 (nbextensions)? 我认为我的扩展已启用...我调用 jupyter nbextension enable事先在他们身上。但我没有在
我将 Jupyter 与 Anaconda3 结合使用。 我的 Anaconda3\ 和 Anaconda3\Scripts\ 文件夹已添加到 %PATH% 变量中。 尽管 jupyter.exe 位
我将 Jupyter 用于我公司的分析。我想制作显示一些漂亮图表的实时页面。我将在大厅的大显示器上显示此页面,我希望它自动刷新。 有什么方法可以通过刷新浏览器页面来触发“运行所有单元格”吗?或者,是否
%store 魔术功能可以保存大型 python 对象,供您在不同 session 之间使用,但我想找出文件的实际位置,以便我也可以在不同 session 之间传输它们不同的电脑。我正在使用 Wind
我在 Windows 10 的本地 Ubunto 机器上运行 Jupyter notebook。问题是所有文本都与屏幕右侧对齐,包括菜单 - 例如"file"选项卡位于最右侧。以这种方式阅读文本非常困
Closed. This question is not reproducible or was caused by typos。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-t
我尝试使用以下内容创建指向 jupyter 笔记本中标题的内部链接。 SO上的各种答案,例如here在我的笔记本中似乎没有按预期工作。下面的代码创建了一个链接,但在尝试访问该链接时没有任何 react
这个问题在这里已经有了答案: How can I share Jupyter notebooks with non-programmers? [closed] (6 个回答) 5年前关闭。 我安装了一
我试图在 jupyter notebook 中自动完成路径。按“tab”后,它显示的不仅仅是文件夹或文件。我认为这些是python的内置功能。有没有办法在自动完成路径时只显示路径和文件? 谢谢! 最佳
我在 Jupyter notebook 中组合了一些数据分析步骤。 随着数据的变化,我希望能够 重新运行所有单元格(以考虑新数据) 转换为html以供查看 我知道我可以通过 jupyter nbcon
在 jupyter 中 笔记本 , 我可以用 nbextensions 配置自动单元计时,结果是这样的: 我怎样才能在 jupyter 中做到这一点 实验室 ?我没有找到任何做类似事情的扩展。 观察:
我正在寻找一个带有 Jupter 可选组件的数据处理集群。 gcloud beta dataproc clusters create cluster-1ea3 --enable-component-g
Jupyter Notebook 的自动完成功能似乎有效,但不知何故它会显示该方法的重复选项。例如下面: 对于每个可能的选项,下拉菜单将显示 2 个相同的选项。为什么会发生这种情况以及如何解决? 最佳
每当我将 jupyter 实验室窗口推到一边时,“简单模式”就会被激活。这导致只显示一个选项卡,而其他选项卡被隐藏。这非常烦人,我不敢相信这是一个标准功能(只是再次安装了 jupyter 实验室)。
当我使用jupyter notebook时, 我希望新单元格的类型为“markdown”。 默认情况下,新单元格的类型为“代码”。我应该修改哪个配置文件以及应该更改哪个变量? 最佳答案 转到您的pyt
奇怪的是,互联网上没有关于如何在 Jupyter 环境下运行 Haskell 的说明。任何引导您实现此目的的文档都需要您从源代码编译,但是当尝试这样做时,会发生各种构建错误。 奇怪的是,一个肯定会给
在带有 ipython 内核的 Jupyter 中,是否有以非阻塞方式执行单元格的规范方法? 理想情况下,我希望能够运行一个单元格 %%background time.sleep(10) print(
我是一名优秀的程序员,十分优秀!