zkmkarlsruhe / ofxTensorFlow2

TensorFlow 2 AI/ML library wrapper for openFrameworks
Other
113 stars 17 forks source link

How to save trained models to load them in ofxTensorFlow2? #41

Open alexdrymonitis opened 2 weeks ago

alexdrymonitis commented 2 weeks ago

I've saved a model with the SavedModel format by calling:

tf.saved_model.save(model, "./1/")

following the instructions here. I have renamed the model to graph_frz.pb, but when I try to load it in example_frozen_graph_char_rnn, I get the following error and the program chrashes:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Invalid GraphDef
[verbose] ofSignalHandler: Aborted

The README file of this example reads: By default ofxTF2::Model will use the SavedModel format. If this is indeed the case, why is the program charshing and how can I save a trained model to load it?

danomatika commented 2 weeks ago

@bytosaur Any thoughts? I wouldn't know.