shenweichen/DeepCTR-Torch

Cannot restore best weights with DeepFM model

congson1293 opened this issue · 3 comments

Hi, I'm using deepctr-torch 0.2.9.
In my code I'm using EarlyStopping as follow:

es = EarlyStopping(monitor='loss', min_delta=0, verbose=1, patience=5, mode='min', restore_best_weights=True)
mdckpt = ModelCheckpoint(filepath='model/model.ckpt', monitor='val_mse', verbose=1,
                         save_best_only=True, mode='min')

history = model.fit(train_model_input, train[target].values, batch_size=128, epochs=100,
                    validation_split=0.1, callbacks=[es, mdckpt], verbose=2)

But when I fit my model I encountered this exception AttributeError: 'DeepFM' object has no attribute 'get_weights'.
Is there anyone know the way to resolve this exception ?
Thank you so much.

Could you please provide your tensorflow version and the detailed error stack trace?

I got the same issue : My tensorflow version is 2.92
The error :
image

I got the same issue:: My tensorflow version is 2.11.0.
And the detailed error stack trace is same as https://user-images.githubusercontent.com/119619206/213330719-1242b237-40d9-4587-83a5-2ab54659f764.png
@zanshuxun