models icon indicating copy to clipboard operation
models copied to clipboard

Installation of Object Detection API fails on aarch64

Open paolotricerri opened this issue 2 years ago • 6 comments

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [x] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • [x] I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • [x] I checked to make sure that this issue has not been filed already.

1. The entire URL of the file you are using

I am following the instruction here: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#tensorflow-object-detection-api-installation and also reviewed the documentation here at: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md

2. Describe the bug

At the pip install instruction I get an AttributeError: cython_sources

Version of some packages I use that I seen recommended:

  • PyYaml = 6.0.0
  • cython: 0.29.36
  • Despite having pip 23.2.1 the option --use-feature 2020-resolver returns an error of an invalid value for the option

3. Steps to reproduce

git clone https://github.com/tensorflow/models.git cd models/research protoc object_detection/protos/*.proto --python_out=. cp object_detection/packages/tf2/setup.py . python -m pip install

4. Expected behavior

Installation to be successful.

5. Additional context

Include any logs that would be helpful to diagnose the problem.

6. System information

  • Linux Ubuntu 22.04 on aarch64:

  • TensorFlow installed from source: Source ErrorTF

  • TensorFlow version (use command below): 2.14.0-rc1 ( from command v2.14.0-rc1-0-gdd01672d9a9 2.14.0-rc1)

  • Python version: 3.10.12

  • Bazel version - 1.18.0 (from https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-arm64)

  • GCC/Compiler version (if compiling from source): 11.4.0

  • CUDA/cuDNN version: -

  • GPU model and memory: -

paolotricerri avatar Oct 06 '23 14:10 paolotricerri

I think the problem is related to PyYAML (see image). How can i fix by installing the 6.0.0 version? if I do pip show PyYAML it shows the 6.0.0 installed but TF models seems to do things with 5.4.1? errorpyyaml

Thanks

paolotricerri avatar Oct 06 '23 17:10 paolotricerri

Hi @paolotricerri ,

Could you please install the latest version pip install tf-models-official=2.13.2 instead of 2.13.0 and make sure upgrade/check the Cython version to be latest version cython>3.0.0.

Please let me know if it is not working after following up above workaround.

Thanks

laxmareddyp avatar Oct 06 '23 17:10 laxmareddyp

Hi @laxmareddyp ,

Thanks for your help!

I have upgraded cython to 3.0.3 but when installing the 2.13.2 version of tf-models-official, I get the error below (dependency with tensorflow-text) ErrorDependency

Thanks,

paolotricerri avatar Oct 07 '23 12:10 paolotricerri

The only way to complete the installation following the instructions provided seems to be by installing PyYAML 5.3

paolotricerri avatar Oct 12 '23 13:10 paolotricerri

I also ran into this issue and to get past this error I first ran: pip3 install pyyaml==5.3

4b11b4 avatar Dec 12 '23 18:12 4b11b4

Found this solution -> https://stackoverflow.com/questions/77490435/attributeerror-cython-sources/77491847#77491847

Worked for me

DanisyEisyraf avatar Feb 07 '24 06:02 DanisyEisyraf