Replies: 5 comments 1 reply
-
First, you should use/run clean_checkpoint.py which leads to obtain the model_best_SHA.pth checkpoint file, and then you can use the file like at a hub checkpoint. For example, model = create_model(arg.model, pretrained=arg.pretrained, num_classes=arg.num_classes, checkpoint=arg.checkpoint) #link to your best checkpoint above.
Good luck
Linh
… On 30 Dec 2020, at 18:40, mrkind ***@***.***> wrote:
On Ubuntu 16.04,I trained my own data and got .pth.tar files in output folder.Each tar file is 1.1GB,but if I click into one tar file I found that there is an "archive" folder with size 0 bytes.In the "archive" folder there is no .pth file.Therefore I wonder how to use these .pth.tar files.
Please could you tell me.Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Thank you,Linh!That sounds clear. |
Beta Was this translation helpful? Give feedback.
-
Hi,everyone,I tried to treate .pth.tar file or the .pkl file obtained from extracting the .pth.tar file as the checkpoint,but failed. python clean_checkpoint.py --checkpoint /home/skjmom/timm_pytorch_im_model/pytorch-image-models-master/output/train/checkpoint-9.pth.tar --output ./output/trained.pth --use-ema --clean-aux-bn python clean_checkpoint.py --checkpoint /home/skjmom/timm_pytorch_im_model/pytorch-image-models-master/output/train/20201228-022118-efficientnet_b7-600/archive/data.pkl --output ./output/trained.pth --use-ema --clean-aux-bn Both error messages are Unpickling error,one of them looks like: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
@mrkind you might be switching back and forth between pytorch 1.6/1.7 and older ones, pytorch changed the checkpoint format in newer versions, which causes an 'archive' error if you load with < 1.6. To use with older ones you need to save the checkpoint with an extra arg. If you run the checkpoint clean script in the newer pytorch version, it will output a cleaned checkpoint in the older format that is loadable by Pytorch < 1.6 and newer. Otherwise @linhduongtuan comment's are correct, the clean script is useful to strip out the extra train specific parts of the training checkpoint for hosting/using the model. |
Beta Was this translation helpful? Give feedback.
-
Much thanks for you two!I successfully obtained trained_SHA.pth |
Beta Was this translation helpful? Give feedback.
-
On Ubuntu 16.04,I trained my own data and got .pth.tar files in output folder.Each tar file is 1.1GB,but if I click into one tar file I found that there is an "archive" folder with size 0 bytes.In the "archive" folder there is no .pth file.Therefore I wonder how to use these .pth.tar files.
Please could you tell me.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions