Hello, I am having an issue when trying to load a keras model from html frontend when posting to flask. The flask_app code is the following:
from tensorflow.keras.models import load_model
app = Flask(name)
def get_model():
global model
model = load_model('saved_model.h5')
print(" * Model loaded!")
get_model()
@app.route('/', methods=["POST"])
def hello_world(): …..
When I am running from console it runs fine but when trying to run from html I get the following: jquery-3.3.1.min.js:2 POST http://myusername.pythonanywhere.com/ 500 (Internal Server Error)
Error running WSGI application OSError: SavedModel file does not exist at: saved_model.h5/{saved_model.pbtxt|saved_model.pb}
Could you please help me?