【问题标题】:tensorflow object detection tutorial error: ipython not definedtensorflow对象检测教程报错:ipython未定义
【发布时间】:2017-11-05 06:34:43
【问题描述】:

我正在研究 github 上的 tensorflow 对象检测 API 教程:https://github.com/tensorflow/models/blob/master/research/object_detection/README.md

我在尝试运行 object_detection_tutorial.py 文件时遇到此错误:

"C:\Users\David\Desktop\ObjectDetection\models\object_detection\object_detection_tutorial2.py", line 32, in <module>
        get_ipython().run_line_magic('matplotlib', 'inline')
    NameError: name 'get_ipython' is not defined

有人介意我的正确方向吗?

还有人有在自己的图像上运行此程序的经验吗?我想在我在房子周围拍的一些照片上对其进行测试,但我不确定如何在 python 中正确编写它,它与这里的这部分有关吗?:

# For the sake of simplicity we will use only 2 images:
# image1.jpg
# image2.jpg
# If you want to test the code with your images, just add path to the images to the TEST_IMAGE_PATHS.
PATH_TO_TEST_IMAGES_DIR = 'test_images'
TEST_IMAGE_PATHS = [ os.path.join(PATH_TO_TEST_IMAGES_DIR, 'image{}.jpg'.format(i)) for i in range(1, 3) ]

【问题讨论】:

  • 您的系统上是否安装了ipythonjupyter

标签: python tensorflow ipython object-detection


【解决方案1】:

要使get_ipython() 函数调用起作用,您需要从IPython 运行您的脚本。否则,没有当前活动的 IPython shell 实例。 documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-22
    • 2018-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-17
    • 2019-01-13
    • 2018-08-01
    相关资源
    最近更新 更多