Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14418

ModuleNotFoundError: No module named 'keras.src' - Python

$
0
0

I am trying to load my model with this code:

`# Load the model with open('tomato_model.pkl', 'rb') as model_file:    #from keras.models import load_model    model = pickle.load(model_file)`

But it kept on returning this errror:

#ModuleNotFoundError: No module named 'keras.src' Traceback: File "C:\Users\CleanTech\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script exec(code, module.__dict__) File "C:\Users\CleanTech\Desktop\Tomatoe\tomato.py", line 156, in <module> model = pickle.load(model_file)^^^^^^^^^^^^^^^^^^^^^^^

And there's no where in my code or model with such module named 'keras.src'

Alternatively I tried using:

with open('tomato_model.pkl', 'rb') as model_file: from keras.models import load_model model = load(model_file)

Still my streamlit could not load rather throwing error.


Viewing all articles
Browse latest Browse all 14418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>