Tensorflow Object detection API for Jetson Nano...stuck on scipy version forever

Hi, some time ago I opened a topic regarding the procedure of installing the TensorFlow object detection API on the Jetson NANO.

I solved the specific problem with protobuf compilation that I asked about in the linked topic (which is now closed), but now I’m getting stuck on something else.
In short, this is what I did so far:

*) installed TF dependencies and TF following these instructions

sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools==49.6.0
sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow

Tensorflow works fine (I can import it in Python), so I went on and tried to install the object detection API following the
official instructions..
When it came to compile the protobuf, I downloaded protoc-3.18.0-linux.aarch_64 from Releases · protocolbuffers/protobuf · GitHub and used to compile the .proto files.
Finally, I ran (as mentioned in the instructions):

cp object_detection/packages/tf2/setup.py .
python -m pip install --use-feature=2020-resolver . 

The problem is that the installation seems to get stuck. It keeps reverting to older versions of scipy, apparently without
finding a compatible one.
Am I doing something wrong? Is there a guide somewhere that I can follow?

Hi,

python -m pip install --use-feature=2020-resolver . 

It looks like you are using python2.
Could you run the command with python3 to see if it helps?

Thanks.

It was a typo, I actually used

python3 -m pip install --use-feature=2020-resolver .

(if you look at the previous commands I used to install the rest of the stuff, I did everything in Python3, if I had been using Python2 for the object detection API it wouldn’t go that far as to check dependencies).

Anyway, I left it running for the whole night, at the end it ran into the error:

ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device

I assume it was because of the number of package versions it was downloading. I guess I could try again after freeing up some space, but I think there’s something wrong with the whole process, it shouldn’t take so long to solve the dependencies. Or should it?

Hi,

[Errno 28] No space left on device

The error indicates you are running out of storage.
Please make sure you have enough space to install it.

Actually, it is common that some installation takes a long time on Jetson Nano.
Especially some package needs to build natively for installation, it might take hours to finish.

Thanks.

I freed up some space on the Nano, and I left the installation run for something like 4 days, but at the end it failed. I didn’t copy the error precisely, but it was something about the dependencies tree becoming to deep to resolve, or something similar.

So, now I did something else.
I flashed a new card with Jetpack 4.5, and followed the instructions in the official post again.

sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools==49.6.0
sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow

Then, installed protobuf by (as I was suggested to do here:

sudo apt-get install protobuf-compiler

Finally, I followed the official instructions to install the TF object detection API, so I did:

git clone https://github.com/tensorflow/models.git
cd models/research
# Compile protos.
protoc object_detection/protos/*.proto --python_out=.
# Install TensorFlow Object Detection API.
cp object_detection/packages/tf2/setup.py .
python3 -m pip install --use-feature=2020-resolver .

The process now fails immediately, with the error:

ERROR: Cannot install object-detection because these package versions have conflicting dependencies.

The conflict is caused by:
    tf-models-official 2.6.0 depends on tensorflow-addons
    tf-models-official 2.5.1 depends on tensorflow-addons

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependenciesr paste code here

I’m sorry for all the posts, but I’ve been stuck on this forever. Now I literally followed the instruction, without installing anything else, on a newly flashed SD card…if this doesn’t work like this, I really don’t know how to do it :(

EDIT: I also tried using

python3 -m pip install --use-feature=2020-resolver .

but I got the same error

Hi,

Thanks for the update.

With JetPack 4.5.1, you should get the TensorFlow package of v2.5.
(Please confirm this in your environment first)

So instead to use the latest source, please git clone the corresponding branch.
For example:

$ git clone -b r2.5.0 https://github.com/tensorflow/models

Thanks.

I checked, and I had Tensorflow v2.5.
However, the object detection API is not available for version 2.5, so if I clone the repository as you suggested there’s no object detection folder at all.
It seems the API is present for version 2.3, which is compatible with Jetpack4.4. I’m flashing the SD again, I’ll try with this version.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.