Error running tensorflow model

Running app locally and the app contains a tensorflow model

I have no separate normalization layer within the model.
model save and load using joblib and tested loading in colab.
Input shape is (1, 224, 224, 3) and confirmed

Error message:

ValueError: Layer ‘normalization’ expected 3 variables, but received 0 variables during loading. Expected: [‘normalization/mean:0’, ‘normalization/variance:0’, ‘normalization/count:0’]
Traceback:
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 534, in _run_script
exec(code, module.dict)
File “E:\Mammogram_app\app.py”, line 53, in
main()
File “E:\Mammogram_app\app.py”, line 27, in main
model = joblib.load(‘Model_EB5’)
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\joblib\numpy_pickle.py”, line 658, in load
obj = _unpickle(fobj, filename, mmap_mode)
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\joblib\numpy_pickle.py”, line 577, in _unpickle
obj = unpickler.load()
File “C:\Users\sony\anaconda3\envs\ali9\lib\pickle.py”, line 1212, in load
dispatchkey[0]
File “C:\Users\sony\anaconda3\envs\ali9\lib\pickle.py”, line 1589, in load_reduce
stack[-1] = func(*args)
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\pickle_utils.py”, line 48, in deserialize_model_from_bytecode
raise e
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\pickle_utils.py”, line 46, in deserialize_model_from_bytecode
model = saving_lib.load_model(filepath, safe_mode=False)
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 281, in load_model
raise e
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 269, in load_model
_load_state(
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 466, in _load_state
_load_container_state(
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 534, in _load_container_state
_load_state(
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 466, in _load_state
_load_container_state(
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 534, in _load_container_state
_load_state(
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\saving\saving_lib.py”, line 435, in _load_state
trackable.load_own_variables(weights_store.get(inner_path))
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\layers\preprocessing\normalization.py”, line 392, in load_own_variables
super().load_own_variables(store)
File “C:\Users\sony\anaconda3\envs\ali9\lib\site-packages\keras\src\engine\base_layer.py”, line 3531, in load_own_variables
raise ValueError(

Use a Different Model Saving Method
TensorFlow SavedModel format or the HDF5 format.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.