The error: Could not make proto path relative: object_detection/protos/*.proto: No such file or directory

I follow the instructions of ‘TensorFlow Hub Object Detection Colab’ in my colab:

!git clone --depth 1 GitHub - tensorflow/models: Models and examples built with TensorFlow
!sudo apt install -y protobuf-compiler
!cd /content/models/research
!protoc object_detection/protos/*.proto --python_out=.
the error: Could not make proto path relative: object_detection/protos/anchor_generator.proto: No such file or directory

note: I have changed the directory path in my colab: !cd /content/models/research, but it’s not working
can someone help me?

Hi @hsiaokai0309, For changing directory in colab you have to use %cd but in your code you have used !cd where the directory will not change.

so when you are executing this command !protoc object_detection/protos/*.proto --python_out=. the object_detection folder will not be present in /content causing the error

If you use %cd the directory change will take place and error will not occur.

please refer to this gist for working code. Thank you.

It’s running. Thank you very much!