Install Tensorflow Object Detection API-Linux

官方网址

1. Downloading the TensorFlow Model Garden

Install Tensorflow Object Detection API-Linux_第1张图片

2. Protobuf Installation/Compilation

Install Tensorflow Object Detection API-Linux_第2张图片
注意这里,我一开始下载的protos 3.20版本,在执行到最后一步时,出现了下面问题:

Traceback (most recent call last):
  File "object_detection/builders/model_builder_tf2_test.py", line 24, in <module>
    from object_detection.builders import model_builder
  File "/home/liujiawang/anaconda3/envs/env_flow/lib/python3.7/site-packages/object_detection/builders/model_builder.py", line 23, in <module>
    from object_detection.builders import anchor_generator_builder
  File "/home/liujiawang/anaconda3/envs/env_flow/lib/python3.7/site-packages/object_detection/builders/anchor_generator_builder.py", line 26, in <module>
    from object_detection.protos import anchor_generator_pb2
  File "/home/liujiawang/anaconda3/envs/env_flow/lib/python3.7/site-packages/object_detection/protos/anchor_generator_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/home/liujiawang/anaconda3/envs/env_flow/lib/python3.7/site-packages/google/protobuf/internal/__init__.py)

后来经过查证,应该是版本问题,随后下载3.15.5版本就成功了。

其中,设置环境变量,如下图所示:
在这里插入图片描述

3. COCO API installation

Install Tensorflow Object Detection API-Linux_第3张图片

4. Install the Object Detection API

Install Tensorflow Object Detection API-Linux_第4张图片

4. Test your Installation

Install Tensorflow Object Detection API-Linux_第5张图片
成功后显示:

Install Tensorflow Object Detection API-Linux_第6张图片

你可能感兴趣的:(linux软件安装,ObjectDetection,tensoflow,API)