query2labels icon indicating copy to clipboard operation
query2labels copied to clipboard

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

Open ShawnALiu opened this issue 2 years ago • 3 comments

看源代码,在训练时,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 avatar Nov 17 '23 06:11 ShawnALiu

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

SlongLiu avatar Nov 17 '23 06:11 SlongLiu

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

好的,谢谢大佬

ShawnALiu avatar Nov 17 '23 06:11 ShawnALiu