Can’t predict with Keras model

I have a simple binary image classification Keras model saved as an h5. It predicts fine in a normal Python session.

In Streamlit I load the model and use numpy to reshape / prepare an image for prediction the same as I do in Python. However the predict step in Streamlit keeps throwing this error:

OSError: [Errno 5] Input/output error


File "/usr/local/lib/python3.10/dist-packages/streamlit/scriptrunner/", line 557, in _run_script
    exec(code, module.__dict__)File "/var/www/mysite/app/pages/", line 225, in <module>
    yhat=model.predict(img)File "/usr/local/lib/python3.10/dist-packages/keras/utils/", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from NoneFile "/usr/local/lib/python3.10/dist-packages/keras/utils/", line 77, in print_msg
1 Like