C3_W2_string_int_label_map_pb2

label_map doesn’t appear to be installing correctly from proto buf

Requirement already satisfied: protobuf==3.20

!cd models/research/ && protoc object_detection/protos/*.proto --python_out=. && cp object_detection/packages/tf2/setup.py . && python -m pip install .

     19 import tensorflow as tf
     20 from google.protobuf import text_format
---> 21 from object_detection.protos import string_int_label_map_pb2
ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'

Restarted session multiple times, played around with version, but making no progress.

Hi @chris.favila is there something update concerning these Labs!

1 Like

Hi, and thank you for reporting! Looking into this now. Will update here asap.

1 Like

Hi! This is now fixed. The issue is the labs selected the GPU runtime by default. It should only use CPU to install the packages successfully. Please relaunch the lab from the classroom to see the changes. Hope this helps and thanks again for reporting!

1 Like

Still had the issue, not sure if it’s an issue with my colab account but had to add the folder to the path. Throwing another error I’ll have to investigate.
sys.path.append(“./models/research”)

/content/models/research/object_detection/core/freezable_sync_batch_norm.py

class FreezableSyncBatchNorm(tf.keras.layers.experimental.SyncBatchNormalization):

AttributeError: module ‘keras._tf_keras.keras.layers’ has no attribute ‘experimental’

Not sure SyncBatchNormalization is in tf 2.15 core, I think it’s BatchNormalization(sync=True) for a distributed strategy (gpu?)

Finally got imports to work by editing the freezable_sync_batch_norm and adding pip installs for tensorflow-io and tf-models-official.

Hi and thank you for the follow up. There might be something going on in Colab. This was working fine earlier when I tested it. Now, the installations won’t run again as expected even with CPU. Will look at this again and update.

The error you saw typically means the TF version required for this assignment (i.e. 2.15) wasn’t installed successfully. Thus, even if you worked around the FreezableSyncBatchNorm error, you will likely get another error further below the assignment (around exercise 6).

Hello again. The lab is now updated to use the fallback runtime. Please relaunch it again from the classroom to see the new instructions. With that, you shouldn’t get that error about that layer. Kindly check. Thank you.

2 Likes

imports worked without having to modify anything this time

1 Like

And the rest of the notebook looks like it is running. My solution has issues, but it looks like I’m messing up the gradients not a notebook issue.

i AM HAVING TROUBLE IMPORTING THE OBJECT_DEETCTION LIBRARY IN COLAB ITSELF

locally? or in the course provided colab?

both, i tried locally after getting multiple times error in colab

then post screenshot of the error first faced in course provided colab.

also @SASWATA_MAITY please if possible create a new topic always for your issue even if you find similar issue threads, you can always share the similar thread link in your created post.

1 Like

sure

1 Like