AttributeError: module 'keras.api._v2.keras.optimizers' has no attribute 'experimental' problem

Viewed 429

I am trying to set up a object detection api in Google Colab. I am trying to follow this tutorial and downloaded the models from github

Object Detection Tuturial

Github Model Garden

I downladed the recent centernet_resnet50_v1_fpn_512x512_coco17_tpu-8 from Model Zoo

When I tried to start the training (step 15 from the tutorial)I got a error like this

File "model_main_tf2.py", line 31, in <module> from object_detection import model_lib_v2 File "/usr/local/lib/python3.7/dist-packages/object_detection-0.1-py3.7.egg/object_detection/model_lib_v2.py", line 31, in <module> from object_detection import model_lib File "/usr/local/lib/python3.7/dist-packages/object_detection-0.1-py3.7.egg/object_detection/model_lib.py", line 35, in <module> from object_detection.builders import optimizer_builder File "/usr/local/lib/python3.7/dist-packages/object_detection-0.1-py3.7.egg/object_detection/builders/optimizer_builder.py", line 25, in <module> from official.modeling.optimization import ema_optimizer File "/content/gdrive/My Drive/TensorFlow/models/official/modeling/optimization/__init__.py", line 23, in <module> from official.modeling.optimization.optimizer_factory import OptimizerFactory File "/content/gdrive/My Drive/TensorFlow/models/official/modeling/optimization/optimizer_factory.py", line 36, in <module> 'adamw_experimental': tf.keras.optimizers.experimental.AdamW, AttributeError: module 'keras.api._v2.keras.optimizers' has no attribute 'experimental'

When I read AttributeError: module 'keras.api._v2.keras.optimizers' has no attribute 'experimental, I fed it to google found two possible solution of using tf-nightly and solution from this link but still failed.

What could cause the error? If the tutorial is outdated, what adjustment shd I make to make it work?

Thank you so so much.

0 Answers
Related