Install the Object Detection API

I have seen a few of the learners raise this issue but with no solution. My code to execute this had been running for a few hours now. Can some one please provide an answer.

Here is the code on colab:
%%bash

cd models/research/

protoc object_detection/protos/*.proto --python_out=.

cp object_detection/packages/tf2/setup.py .

python -m pip install .

Hi @nbandhi Could you please be a bit more specific about your problem? It would help if you specified the environment you’re running this snippet on. Cheers.

Balaji,

I resolved. The code in this block needs to be updated. I remove the %%bash and started the block with !cd

Thanks

Narayana

1 Like

Hi Narayana,

My issue was that I ended up with pip trying to solve dependencies for ever. After upgraing pip., it all worked fine with: pip install – upgrade pip in bash script.
‘’’
%%bash
pip install – upgrade pip
sudo apt install -y protobuf-compiler
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .

I got the solution from: Issue at model garden: Broken dependencies #10334.

/Tomas

Hi Tomas,

I am not sure this one is working either its taking so long, I have reported this as an issue lets see if the QA team has a better workaround.

Hi everyone! This is due to Colab updating its TF version to TF2.7 . We have now revised the install script. Please reopen the notebook from the classroom to see the changes. It should run faster now but let me know if you’re still having issues. Thanks!

1 Like

Hi,
There are a lot of issues with the “Use the Object Detection API” colab notebook. It runs at the end, but after loading the model, there are many many lines with this warning:

WARNING:absl:Importing a function (__inference_batchnorm_layer_call_and_return_conditional_losses_42408) with ops with unsaved custom gradients. Will likely fail if a gradient is requested.

Before this:

I updated pip with: pip install --upgrade pip
I corrected the path on the first %%bash cell, from cd models/research to
cd /content/models/research

Also, at the very beginning there are errors about the pip’s dependencies. I just opened the link from coursera to the notebook in colab.

Like I said, it runs (the detections are displayed) but any ideas about the warnings?

Thank you

Hi,

Yeah there have been some updates with tensorflow (as it happens with time) so warnings or even sometimes errors might arise. I think the object detection lab is not run by our team here.

Thanks. But could you raise an issue please? just like you did for the following notebook.

Hi Dea,

Did any of the proposed solutions worked for you? Also which lab is this exaclty (paste the link here). I will have alook on it and if possible I will raise an issue.

That lab is a tensorflow tutorial, is not run by the team here, but it did run entirely for me despite of the warnings.