import wandb
#resume the run
run = wandb.init(project='wandb_demo', id= model.run_id, resume='must')
# save dataset
arti_dataset = wandb.Artifact('mnist', type='dataset')
arti_dataset.add_dir('********')
wandb.log_artifact(arti_dataset)
# save code
arti_code = wandb.Artifact('ipynb', type='code')
arti_code.add_file('***********')
wandb.log_artifact(arti_code)
# save model
arti_model = wandb.Artifact('cnn', type='model')
arti_model.add_file(config.ckpt_path)
wandb.log_artifact(arti_model)
wandb.finish() #finish时会提交保存
#****表示为文件路径