【问题标题】:Tensorflow API Ubuntu ErrorTensorFlow API Ubuntu 错误
【发布时间】:2018-10-04 11:04:16
【问题描述】:
python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record
Traceback (most recent call last):
  File "generate_tfrecord.py", line 20, in <module>
    from utils import dataset_util
ImportError: cannot import name dataset_util

我有导入问题 完整代码在这里 https://hastebin.com/inolutefip.py

【问题讨论】:

  • 欢迎来到 Stack Overflow!在这里,我们希望 code 出现在 问题帖子中 本身(作为文本),而不是链接。请edit问题并做出适当的更正。要格式化代码,您可以在选择代码时使用Ctrl+K{} 按钮。

标签: python linux ubuntu tensorflow object-detection


【解决方案1】:

您需要将 PYTHONPATH 设置为 object_detection 文件夹。该文件正在尝试从research/object_detection/util 文件夹导入dataset_util 文件。设置 PYTHONPATH 因操作系统而异。

以下链接包含 TensorFlow 对象检测 API 的面向 Ubuntu 的说明:

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md#add-libraries-to-pythonpath

以下链接包含 TensorFlow 对象检测 API 的面向 Windows 的说明: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#2e-configure-pythonpath-environment-variable

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-20
    • 1970-01-01
    • 2018-01-28
    • 2019-05-21
    • 2018-07-28
    • 2019-05-22
    • 1970-01-01
    相关资源
    最近更新 更多