-1

My friends and I are partaking in a hackathon and are stuck on this one tutorial on training an object detection model:

https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html

But after three people have tried to follow the above tutorial to the letter, we are all stuck on the creating TfRecord step:

https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records

We get the error message:

ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'

We are three different people, with three different machines, getting this result, and have spent in total 20+ person-hours googling, retrying, sacrificing things to eldritch gods and nothing gets us passed this hurdle.

Is there a better way of achieving the result, or a fix for the issue? We are inexperienced with Tensorflow and are just wanting to use it to train a model that can be converted to an onnx model that will be consumed by ml.net.

Elletlar
  • 3,136
  • 7
  • 32
  • 38
Frank R. Haugen
  • 210
  • 3
  • 11

2 Answers2

1

Thanks to @EdwinCheong for pointing us in the correct direction.

The issue was resolved by basically downloading the Windows 10 SDK and a bunch of c++ -related packages in the Visual Studio Installer before following this linked tutorial: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#tf-models-install related to installing object detection. CUDA seems to be required regardless of what the tutorial says

Frank R. Haugen
  • 210
  • 3
  • 11
  • Followed the link but still having same error message. My computer does not have GPU chip so there was no need to install CUDA nor cuDNN libraries. This won't work if there is no GPU? SHould I install these libraries even though these libraries will not be useful since my computer does not have GPU? – Nguai al Dec 02 '21 at 21:51
  • @Nguaial Don't install any libraries requiring GPU if your computer don't have one (Sorry for late reply) – Frank R. Haugen Mar 15 '22 at 18:54
1

The solution that works for me is as follows:

If you are creating a Virtual environment:

Run the command after you create the environment to change the Google file .protp to .py:

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

However, if you are still facing an error, you can simply run the code on a google colab notebook:

Protos Conversion to Python %%cd /content/drive/MyDrive/TFOD1.x/models/research

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

get the file in protoc folder, then copy it into the >models>research>protoc And (import step): Copy the folder to your environment path:

For example:

C:\Users\x04xx18\Anaconda3\envs\tfod1.x\libs\protos

This should fix the error for you!