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

为什么训练时保存的是.pth文件,推理时用的是.pkl文件? #53

Open
ShawnALiu opened this issue Nov 17, 2023 · 3 comments

Comments

@ShawnALiu
Copy link

看源代码,在训练时,main_mlc.save_checkpoint里面,结果保存在model_best.pth.tar,这样的pth文件。
在推理的时候,作者给的脚本

python q2l_infer.py -a modelname --config /path/to/json/file --resume /path/to/pkl/file [other args]
e.g.
python q2l_infer.py -a 'Q2L-R101-448' --config "pretrained/Q2L-R101-448/config_new.json" -b 16 --resume 'pretrained/Q2L-R101-448/checkpoint.pkl'

为啥是这样啊?应该怎么处理?

@ShawnALiu ShawnALiu changed the title 为什么训练时保存的是.th文件,推理时用的是pkl文件? 为什么训练时保存的是.pth文件,推理时用的是.pkl文件? Nov 17, 2023
@SlongLiu
Copy link
Owner

可能我没注意。 重命名一下文件应该就行了

@ShawnALiu
Copy link
Author

可能我没注意。 重命名一下文件应该就行了

好的,谢谢大佬

@djdll
Copy link

djdll commented Sep 30, 2024

为什么下载的预训练模型是pkl,加载预训练模型是pth,请问这个应该如何修改

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

3 participants