Are you awaiting for initialize to complete before trying to call model.predict? It seems your model is not ready yet when you try and call this function. If you can link us to live demo that would be helpful as hard to see from screenshots what state is at runtime.