I have a pre-trained keras model (in .hdf5 form) that I am planning to deploy using a Django Web-App. In my views file it is called upon when a certain POST request is passed in. I have stored in .hdf5 model in the static folder associated with my web-app. However, when i call keras.models.load_model to try and load the model from the static directory the app returns the following error:
Unable to open file (unable to open file: name = '/static/model.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
However, the model is clearly in my static folder so I'm not sure why the load_model function is not working to load the model.
If there is some reason for this or a workaround I am not sure of it so any information regarding a solution would be helpful. I am also willing to switch to a tensorflow serving model or otherwise if this is a keras issue/it would be beneficial.
What is the reason I am not able to load my keras model from my Django app and how can I remedy the situation?