我正在尝试使用tf.keras.experimental.export_saved_model(model,saved_model_dir)将.pb或.pbtxt格式保存为模型,如以下教程中所述:
但是我得到了错误:
init ()缺少1个必需的位置参数:“ feature_columns”
在此先感谢您的帮助。下面的代码:
#my code, the model trains without any problems:
training_history = model.fit(train_ds,
validation_data=val_ds,
epochs=epochs,
callbacks=[EarlyStopping(patience=patience), tensorboard_callback ])
now=str(datetime.datetime.now()).replace(':','_').replace(' ','_').replace('.','_')
saved_model_dir="saved_models/"+now
tf.keras.experimental.export_saved_model(model, saved_model_dir)
#I get the following error:
TypeError: __init__() missing 1 required positional argument: 'feature_columns'