[英]How to log artifacts in wandb while using saimpletransformers?
I am creating a Question Answering model using simpletransformers .我正在使用simpletransformers创建一个问答模型。 I would also like to use wandb to track model artifacts.我还想使用 wandb 来跟踪模型工件。 As I understand from wandb docs , there is an integration touchpoint for simpletransformers but there is no mention of logging artifacts.正如我从wandb docs了解到的, simpletransformers有一个集成接触点,但没有提到记录工件。
I would like to log artifacts generated at the train, validation, and test phase such as train.json, eval.json, test.json, output/nbest_predictions_test.json and best performing model.我想记录在训练、验证和测试阶段生成的工件,例如 train.json、eval.json、test.json、output/nbest_predictions_test.json 和最佳性能模型。
Currently simpleTransformers doesn't support logging artifacts within the training/testing scripts.目前 simpleTransformers 不支持在训练/测试脚本中记录工件。 But you can do it manually:但是你可以手动完成:
import os
with wandb.init(id=model.wandb_run_id, resume="allow", project=wandb_project) as training_run:
for dir in sorted(os.listdir("outputs")):
if "checkpoint" in dir:
artifact = wandb.Artifact("model-checkpoints", type="checkpoints")
artifact.add_dir("outputs" + "/" + dir)
training_run.log_artifact(artifact)
For more info, you can follow along with the W&B notebook in the SimpleTransofrmer's README.md有关更多信息,您可以跟随 SimpleTransofrmer 的 README.md 中的 W&B 笔记本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.