【问题标题】:Tensorflow NotFoundError: data/mscoco_label_map.pbtxt; No such file or directoryTensorFlow NotFoundError:数据/mscoco_label_map.pbtxt;没有相应的文件和目录
【发布时间】:2018-05-02 15:46:51
【问题描述】:

我正在尝试从 YouTuber sentdex 运行 this 脚本,但出现此错误:

This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'TkAgg' by the following code:
  File "Desktop/object.py", line 11, in <module>
    from matplotlib import pyplot as plt
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 71, in <module>
    from matplotlib.backends import pylab_setup
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 16, in <module>
    line for line in traceback.format_stack()


  import matplotlib; matplotlib.use('Agg')  # pylint: disable=multiple-statements
Traceback (most recent call last):
  File "Desktop/object.py", line 86, in <module>
    label_map = label_map_util.load_labelmap(PATH_TO_LABELS)
  File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/models/research/object_detection/utils/label_map_util.py", line 132, in load_labelmap
    label_map_string = fid.read()
  File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
    self._preread_check()
  File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "/home/wdjpng/.local/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory

操作系统:Ubuntu 18.04

Python:2.7

你能帮帮我吗?

【问题讨论】:

    标签: tensorflow artificial-intelligence object-detection


    【解决方案1】:

    如果您提供了您调用的文件/函数来生成回溯,这将非常有帮助。但是,在没有这一点的情况下,基于以下内容:

    tensorflow.python.framework.errors_impl.NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory
    

    *_label_map.pbtxt 路径在 model.config 文件的两行中指定(确切的行号取决于您选择的模型)。训练/测试文件路径中的一个或两个似乎不正确。

    【讨论】:

      猜你喜欢
      • 2020-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多