首页 > 解决方案 > Tensorflow 对象检测 API 中的错误

问题描述

我正在关注本教程

但是当我运行命令时

python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record

我收到以下错误,我该如何解决这些问题

C:\Users\ASUS PC\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "generate_tfrecord.py", line 20, in <module>
    from object_detection.utils import dataset_util
ModuleNotFoundError: No module named 'object_detection'

标签: python-3.xtensorflow

解决方案


您可能忘记了这样做,或者根据您自己的安装更改了路径:

set PYTHONPATH=C:\tensorflow1\models;C:\tensorflow1\models\research;C:\tensorflow1\models\research\slim

您应该替换C:\tensorflow1\models为计算机上 tensorflow/models 目录的路径。

或者你已经退出了你的虚拟环境并回到了它,所以你需要再次使用这个命令。(请参阅链接教程的第 2e 部分)


推荐阅读