我微调了 HuggingFace 的 DistilBert 模型以进行序列分类(Claim vs. Premise vs. Non-Arg.)。
我正在尝试使用 save_pretrained 函数保存模型,但出现此错误:
AttributeError: 'Functional' object has no attribute 'save_pretrained'
型号代码如下
input = keras.Input(shape=(None,features.shape[1],), dtype='float32')
encoded = layers.Dense(32)(input)
ouput = layers.Dense(3, activation='softmax')(encoded)
model = keras.Model(input, ouput)
model.summary()
model.compile("rmsprop", "categorical_crossentropy", metrics=["accuracy"])
model.fit(X_train, y_train, batch_size=128, epochs=25, validation_data=(X_test, y_test))
有没有人有同样的问题或想法我该如何解决?