python-3.x - 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'
解决方案
您可能忘记了这样做,或者根据您自己的安装更改了路径:
set PYTHONPATH=C:\tensorflow1\models;C:\tensorflow1\models\research;C:\tensorflow1\models\research\slim
您应该替换C:\tensorflow1\models
为计算机上 tensorflow/models 目录的路径。
或者你已经退出了你的虚拟环境并回到了它,所以你需要再次使用这个命令。(请参阅链接教程的第 2e 部分)
推荐阅读
- html - css中的卡片布局,使用网格
- asp.net - 错误 400:redirect_uri_mismatch google auth Asp.net mvc
- jquery - 使用jquery获取json的值
- reactjs - Material-UI Styled API:类不适用于子元素
- webpack-dev-server - Vite:在 Vite 中配置类似 webpack-dev-server 的功能
- google-cloud-platform - 将特定 GKE 标签(不是 Kubernetes 标签)添加到节点池
- java - 如何使用 Java 列出文件中所有导入类的所有方法?
- json-schema-validator - networknt 模式验证器,获取已解析 $ref 的模式
- swift - Firebase GeoFire 关闭
- javascript - 用Javascript中的JSON值过滤掉特定的键?