Fiz com pede a aula:
import tensorflow
from tensorflow.keras.models import load_model
modelo.save('modelo.h5')
modelo_salvo = load_model('modelo.keras')
aparece o seguinte erro:
WARNING:absl:You are saving your model as an HDF5 file via model.save() or keras.saving.save_model(model). This file format is considered legacy. We recommend using instead the native Keras format, e.g. model.save('my_model.keras') or keras.saving.save_model(model, 'my_model.keras').
ValueError Traceback (most recent call last)
/tmp/ipython-input-2349117680.py in <cell line: 0>()
2 from tensorflow.keras.models import load_model
3 modelo.save('modelo.h5')
----> 4 modelo_salvo = load_model('modelo.keras') # Diga ao load_model como lidar com 'softmax_v2'
/usr/local/lib/python3.12/dist-packages/keras/src/saving/saving_api.py in load_model(filepath, custom_objects, compile, safe_mode)
198 )
199 elif str(filepath).endswith(".keras"):
--> 200 raise ValueError(
201 f"File not found: filepath={filepath}. "
202 "Please ensure the file is an accessible .keras "
ValueError: File not found: filepath=modelo.keras. Please ensure the file is an accessible .keras zip file.
Como resolver?????