j-min / VL-T5

PyTorch code for "Unifying Vision-and-Language Tasks via Text Generation" (ICML 2021)
https://arxiv.org/abs/2102.02779
MIT License
360 stars 57 forks source link

No model.zero_grad() #12

Closed Richar-Du closed 2 years ago

Richar-Du commented 2 years ago

Thanks for your awesome work! I noticed you comment the mode.zero_grad() in https://github.com/j-min/VL-T5/blob/18699e2b1d5b4559f76c88a48cdec7176d356c34/VL-T5/src/caption.py#L225 So how could the model update its parameters?

Don-Joey commented 2 years ago

I don't know whether this page can help you?https://colab.research.google.com/github/pytorch/tutorials/blob/gh-pages/_downloads/c967c71b525d3cbe07b940373140aaef/tuning_guide.ipynb#scrollTo=9_w6Pso10xBR

j-min commented 2 years ago

param.grad=None replaces model.zero_grad() here.