Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting auto-keras model and keras model doesn't act same #612

Closed
serengil opened this issue Apr 7, 2019 · 2 comments
Closed

Exporting auto-keras model and keras model doesn't act same #612

serengil opened this issue Apr 7, 2019 · 2 comments
Labels

Comments

@serengil
Copy link

serengil commented Apr 7, 2019

Hello,

I fit a model in auto-keras and it gets 66.23% accuracy. Then I export this model in both auto-keras and regular keras format.

model.export_autokeras_model('best_autokeras_model.h5')
model.export_keras_model('best_keras_model.h5')

After then, I load these models in a different notebook.

1- Loading auto-keras model gives the same result with training. This is ok.

from autokeras.utils import pickle_from_file
autokeras_model = pickle_from_file("best_autokeras_model.h5")
autokeras_score = autokeras_model.evaluate(x_test, y_test)
print(autokeras_score)

autokeras_predictions = autokeras_model.predict(x_text)

0.6623014767344664

I also check autokeras_predictions and y_test. Really 66.23% are same.

2- Loading keras model crashes.

from keras.models import load_model
keras_model = load_model('best_keras_model.h5')

keras_predictions = keras_model.predict(x_test)

keras_predictions_exact = []

for i in range(0, len(keras_predictions)):
    keras_predictions_exact.append(np.argmax(keras_predictions[i]))

It seems the exporting regular keras model doesn't export final weights of the model. Is this a known act? I should re-train it?

@stale
Copy link

stale bot commented Aug 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 12, 2019
@stale stale bot closed this as completed Aug 19, 2019
@crypdick
Copy link

Potentially related to #186 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants