1

Is there a way to export/save/load a previously trained autokeras model? I understand I can use the following code to save/load the underlying tensorflow best model:

model = reg.export_model()
model.save(MODEL_FILEPATH, save_format="tf")    
best_model = load_model(MODEL_FILEPATH, custom_objects=ak.CUSTOM_OBJECTS)

However, in practice that wouldn't work, since my data has been fitted by autokeras, which takes care of data preparation and scaling. I don't think I have access to what autokeras is doing to the input data (X) before actually fitting, so I can't actually use the exported tensorflow best model to predict labels for new samples with un-prepared and unscaled features.

Am I missing something major here?

Also I noticed that there are some binaries in the autokeras temporary dir. That dir seems to be generated automatically. Is there a way to use that dir to load the previously-fit autokeras "super" model?

Martin Klosi
  • 3,098
  • 4
  • 32
  • 39

1 Answers1

0

Just using import pickle will do the job - https://github.com/keras-team/autokeras/issues/1081#issuecomment-645508111 :

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Martin Klosi
  • 3,098
  • 4
  • 32
  • 39