You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: ValueError: Cannot get result() since the metric has not yet been built during model.fit()
2. Description:
Summary
I encountered a ValueError: Cannot get result() since the metric has not yet been built when trying to train my model using model.fit(). This happens in the first epoch, and the error is thrown from compile_utils.py.
## Error Traceback```plaintextEpoch 1/10Traceback (most recent call last): File "path/to/train.py", line 85, in <module> model_test_1.fit( File "C:\Path\to\Python312\Lib\site-packages\keras\src\utils\traceback_utils.py", line 122, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Path\to\Python312\Lib\site-packages\keras\src\trainers\compile_utils.py", line 356, in result raise ValueError(ValueError: Cannot get result() since the metric has not yet been built.
Environment Details
TensorFlow Version: 2.17.0
Keras Version: 3.5.0
Python Version: 3.12.4
Additional Information
I am using a model with two inputs, and I have defined the metrics as part of model.compile(). However, I am still encountering the above error.
Any guidance on what could be causing this issue would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
@rohitcodism , Use keras directly for your model, since the above linked fix will be available in Keras-nightly version, where Tensorflow 2.17.0 uses Keras >=3.2
Example:
!pip install keras-nightly
import keras
from keras.layers import Dense
1. Title:
Error: ValueError: Cannot get result() since the metric has not yet been built during model.fit()
2. Description:
Summary
I encountered a
ValueError: Cannot get result() since the metric has not yet been built
when trying to train my model usingmodel.fit()
. This happens in the first epoch, and the error is thrown fromcompile_utils.py
.Environment Details
Additional Information
I am using a model with two inputs, and I have defined the metrics as part of
model.compile()
. However, I am still encountering the above error.Any guidance on what could be causing this issue would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered: