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

save trained model to checkpoing? #1

Open
yuyangxie96 opened this issue Mar 24, 2022 · 1 comment
Open

save trained model to checkpoing? #1

yuyangxie96 opened this issue Mar 24, 2022 · 1 comment

Comments

@yuyangxie96
Copy link

I noticed that Line 158 of main.py controls saving the model to the checkpoint. When I run lra-text, the trained model is not saved, and the performance seems to be overfitting. Are there some problems or mistakes here?

@pkuzengqi
Copy link
Owner

pkuzengqi commented Mar 30, 2022

Checkpoint saving:
See

if dev_accu > best_dev_accu:

if dev_accu > best_dev_accu:
        best_dev_accu = dev_accu
        if (train_step_idx + 1) > total_step * 0.2:
            torch.save({"model_state_dict":model.state_dict()}, checkpoint_path)
            print('best model saved: step = ',train_step_idx, 'dev accu = ',dev_accu)

It's controlled not to save too frequently. You may drag the torch.save() out for the case of lra-text (quickly overfitting) or disable line 158.

Overfitting:
All models seem to overfit this dataset. I post a dev loss fig on the last page of https://arxiv.org/pdf/2112.05359.pdf for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants