auto_ml icon indicating copy to clipboard operation
auto_ml copied to clipboard

Loading deep learning model has an error

Open aojue1109 opened this issue 6 years ago • 2 comments

Executing code loading deep learning model has the following error

from auto_ml.utils_models import load_ml_model trained_ml_pipeline = load_ml_model("auto_ml_saved_pipeline.dill") trained_ml_pipeline.predict(data)

An error occurred:

Traceback (most recent call last): File "/root/situ/automl/ctest.py", line 48, in trained_ml_pipeline = load_ml_model("auto_ml_saved_pipeline.dill") File "/root/anaconda3/envs/automl/lib/python3.6/site-packages/auto_ml/utils_models.py", line 629, in load_ml_model pipeline_step.model = insert_deep_learning_model(pipeline_step, file_name) File "/root/anaconda3/envs/automl/lib/python3.6/site-packages/auto_ml/utils_models.py", line 594, in insert_deep_learning_model model = keras_load_model(keras_file_name) TypeError: 'NoneType' object is not callable

aojue1109 avatar Aug 24 '18 03:08 aojue1109

I am also having this issue, making it very hard to run different datasets

jameshgrn avatar Sep 20 '18 02:09 jameshgrn

The problem is that the initialization of keras is done in utils_models.get_model_from_name(). Which, in turn, is called only from a couple places in Predictor. The workaround for this bug is to call the method directly before loading the model:

from auto_ml import utils_models
     ...
utils_models.get_model_from_name ('DeepLearningRegressor')
model = utils_models.load_ml_model (file_name)

sbertech avatar Sep 24 '18 19:09 sbertech