【问题标题】:Cant install Tensorflow object detection API (Python)无法安装 TensorFlow 对象检测 API(Python)
【发布时间】:2021-10-15 14:01:07
【问题描述】:

我找到了安装说明,但尽管设置了 sys 路径,但它给了我错误提示 No such file or directory: 'content/drive/MyDrive/TensorFlow/models/research' 这是我从克隆存储库到设置路径的全部代码:

%cd /content/drive/My Drive/Tensorflow
!git clone https://github.com/tensorflow/models.git

!apt-get install protobuf-compiler python-lxml python-pil
!pip install Cython pandas tf-slim lvis

%cd /content/drive/My Drive/Tensorflow/models/research
!protoc object_detection/protos/*.proto --python_out=.

import os
import sys


os.environ['PYTHONPATH']+=":/content/drive/MyDrive/TensorFlow/models"

sys.path.append("/content/drive/MyDrive/TensorFlow/models/research")
sys.path.append('/content/drive/MyDrive/TensorFlow/models/research/slim')
print("done")

【问题讨论】:

    标签: python tensorflow object-detection


    【解决方案1】:

    通过安装所有必需的包来使用对象检测 API 的最佳方法是按照官方 repo here 2.x 版和here 1.x 版 Tensorflow 中给出的说明进行操作

    完成安装并使用上述链接成功运行所有测试后,您可以使用文档here 了解如何使用它来训练或测试您自己的数据集

    【讨论】:

    • 一切正常。但是我必须在哪里复制这个“!cp object_detection/packages/tf2/setup.py”,因为它应该像这样“!cp source destination”,所以其中一个丢失了。
    • 如果你仔细看,命令是cp object_detection/packages/tf2/setup.py .。最后在setup.py 之后有一个.. 表示当前目录。如前所述,您应该从models/research 目录执行这些命令,因此,setup.py 将被复制到models/research 目录
    • 非常感谢您的解释。我已经解决了问题)
    • 如果解决了您的问题,请考虑通过单击勾选按钮将答案标记为已接受 :)
    • 是的,我已经这样做了,但是由于我的声望低于 10 声望超过 10 后才会考虑)
    猜你喜欢
    • 2018-07-17
    • 1970-01-01
    • 2021-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-16
    • 2017-12-02
    相关资源
    最近更新 更多