I have a model with a relatively complicated computational graph and am about to train it on a large set of data. How can I save the trained model afterwards, so that I can just load its (structure + weights) without specifying the complicated model structure again? I just want to a single file "trained_model" that I can load from any other tensorflow code without the need to know how the internal structure looks like. Put in other words, I want to use the trained model as a black box later on. Is there something like this in tensorflow? I am a little bit confused by the stuff I find on the internet myself, maybe one of you experts can help me out. Thanks so much in advance!
So what I would like to have is the following:
trained_model_path = '.../trained_model/
trained_model = load_model_from_file(trained_model_path) # black box!
trained_model.predict(x)