DeepTables icon indicating copy to clipboard operation
DeepTables copied to clipboard

Load saved models doesn't find MultiColumnEmbedding layer

Open gladomat opened this issue 4 years ago • 2 comments

I tried loading a saved model but it can't load it and instead gives an error:

from tensorflow.keras.models import load_model mod_path = 'model_1.h5' load_model(mod_path)

The error:

ValueError: Unknown layer: MultiColumnEmbedding

gladomat avatar May 18 '20 15:05 gladomat

There are two ways:

dt.save(filepath)
newdt = deeptable.DeepTable.load(filepath)
preds = newdt.predict(X_test)
from deeptables.models.layers import dt_custom_objects
from tensorflow.keras.models import load_model 

mod_path = 'model_1.h5' 
load_model(mod_path, dt_custom_objects)

jackguagua avatar May 19 '20 01:05 jackguagua

There's a bug in deeptable.py at line 660 where the model is saved. Please change os.makedirs to os.makedir.

gladomat avatar Jun 02 '20 14:06 gladomat