How can we download weights from kaggle

Hi If i train my model into the kaggle machine,
I am able to do learn.save at the end…
But dont know how to download those weights,it gets saved in he tmp directory ,upon reinitializing the kernel that all goes away…
Please suggest any way if there is any to download the saved weights so u can use them next time??

1 Like

You can but it’s a faff.

  1. Commit your notebook
  2. The output is now available, so you can download here
  3. If you go to the output tab of notebook (note: this is when commit is complete, and you click view version), and click create notebook using output data
  4. In editor, add new dataset of the competition you are doing
  5. Adjust paths/copy weights to tmp dir if necessary

save the weights:
–learn.save(‘testing’)

download with FileLink:
–from IPython.display import FileLink
–FileLink(‘testing.pth’)

It will create a download link from which you can directly download the weights.

2 Likes

thanks …its working.