### data/mscoco_label_map.pbtxt; 找不到该文件或目录

请帮帮我!提前谢谢您。我正在使用Google Colab中的Python创建一个对象检测器。

请告诉我该怎么做?是否有模块版本错误或文件目录缺失?如果目录缺失,请告诉我如何添加。请尽快帮助我,再次非常感谢您。

当我运行这段代码时,它显示了这个错误

label_map = label_map_util.load_labelmap(PATH_TO_LABELS)categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=NUM_CLASSES, use_display_name=True)category_index = label_map_util.create_category_index(categories)```.**这是输出内容**WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/object_detection/utils/label_map_util.py:132: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.---------------------------------------------------------------------------NotFoundError                             Traceback (most recent call last)<ipython-input-9-b47b5c1dba35> in <module>()      1 import os----> 2 label_map = label_map_util.load_labelmap(PATH_TO_LABELS)      3 categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=NUM_CLASSES, use_display_name=True)      4 category_index = label_map_util.create_category_index(categories)2 frames/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/lib/io/file_io.py in _preread_check(self)     82                                            "File isn't open for reading")     83       self._read_buf = pywrap_tensorflow.CreateBufferedInputStream(---> 84           compat.as_bytes(self.__name), 1024 * 512)     85      86   def _prewrite_check(self):NotFoundError: data/mscoco_label_map.pbtxt; No such file or directory

回答:

您定义的PATH_TO_LABELS是什么?

它应该指向您的pbtxt文件(最好是完整路径 – 即在Colab中以/content开头)。

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注