0

When I use keras Tuner for tuning, tuner=RandomSearch(hypermodel=model,objective='mse',seed=42,max_trials=3,directory=r'E:\multivariate test\bayes',project_name=' helloworld') reported an AttributeError: module'tensorflow._api.v1.keras.metrics' has no attribute'Metric', error,how to solve this problem?

1 Answers1

0

Maybe you are using TF v < 2.2. You can check this page [https://www.tensorflow.org/api_docs/python/tf/keras/metrics/Metric]. There you can find this: tf.keras.metrics.Metric