C3_w2 assignment Exercise 5.4: Build the custom model Need help

I believe my code is correct.

START CODE HERE (Replace instances of None with your code)

END CODE HERE

print(type(detection_model))

But get an error:
ValueError Traceback (most recent call last)
in
1 ### START CODE HERE (Replace instances of None with your code) ###
----> 2 detection_model = model_builder.build(model_config, is_training= True)
3 ### END CODE HERE ###
4
5 print(type(detection_model))

2 frames
/usr/local/lib/python3.7/dist-packages/object_detection/builders/model_builder.py in _check_feature_extractor_exists(feature_extractor_type)
268 '{} is not supported for tf version {}. See model_builder.py for ’
269 'features extractors compatible with different versions of ’
→ 270 ‘Tensorflow’.format(feature_extractor_type, tf_version_str))
271
272

ValueError: is not supported for tf version 2. See model_builder.py for features extractors compatible with different versions of Tensorflow

Hello, that part of the code is right but can you check you tf.version you might not have the right one.

print(tf.version)

<module ‘tensorflow._api.v2.version’ from ‘/usr/local/lib/python3.7/dist-packages/tensorflow/_api/v2/version/init.py’>
this is the result, anything wrong?

tfversion
It should give something like this. If you run that cell in Colab.

Try resetting the kernel and rerun everything again. If still problems try installing

!pip install tensorflow==2.5.0

and try to run again.

I checked tf version it is 2.8.2 and I do run it in Colab.
I also tried to install 2.5.0 as you suggested but failed at Exercise 1, errors as below:


AttributeError Traceback (most recent call last)
in
10
11 # import module for building the detection model
—> 12 from object_detection.builders import model_builder
13 ### END CODE HERE ###
14

9 frames
/usr/local/lib/python3.7/dist-packages/keras/layers/core/dropout.py in
24
25 @keras_export(‘keras.layers.Dropout’)
—> 26 class Dropout(base_layer.BaseRandomLayer):
27 “”"Applies Dropout to the input.
28

AttributeError: module ‘keras.engine.base_layer’ has no attribute ‘BaseRandomLayer’

Hmm, no you should go back to version 2.8.2 then, i hope there are no tf updates that have happened recently which need the lab to be updated to. I will try and run this lab tommorow and see myself if i get the error…

Hello, send me on private message your notebook, there might be an issue but i need to check before raising it for the staff.

Don Zhu, I have checked your notebook, that mistake is actually coming up because at the “pipeline_config=” line, you are not choosing the correct model and it actually tells you right there what to choose. So go back and fix that and the error you are getting at model.builder will not appear again.

I made the same error…Thank you for the advice