Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddle.Model.fit在eval阶段不打印传入的metrics结果,最优结果的保存似乎也没有 #170

Closed
bbbxixixixi opened this issue Mar 18, 2021 · 3 comments
Assignees
Labels

Comments

@bbbxixixixi
Copy link

用SimNet做了个语义判断的程序
model = ppnlp.models.SimNet(
network='gru',
emb_dim=256,
vocab_size=len(vocab),
num_classes=3)
model = paddle.Model(model)
optimizer = paddle.optimizer.AdamW(
parameters=model.parameters(), learning_rate=0.001)
criterion = paddle.nn.CrossEntropyLoss()
metric = paddle.metric.Accuracy()
model.prepare(optimizer, criterion, metric)
model.fit(
train_loader,
evl_loader,
epochs=20,
save_dir='pretrained_model' )
发现在eval阶段只是输出loss等信息,并不会打印出整个eval data的评价指标
然后在最后结束时只存了个final model,paddlex会存一个best model,paddlenlp现在会根据eval阶段的最优解指标存一个模型吗?

@Steffy-zxf Steffy-zxf self-assigned this Mar 19, 2021
@Steffy-zxf
Copy link
Contributor

你好!paddle.Model.fit在eval阶段会打印eval data的评价指标。并且打印的指标是从一个累积的数值。同时paddle.Model.fit可以指定save_freq参数,间隔epoch数之后保存模型参数,参考 https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/hapi/model/Model_cn.html#model

simnet训练示例代码参考:https://github.com/PaddlePaddle/PaddleNLP/tree/release/2.0-rc/examples/text_matching/simnet

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

@github-actions github-actions bot added the stale label Feb 26, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants