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

调用evaluation脚本时每次准确率结果会有细微的差别 #104

Open
jackyjinjing opened this issue Apr 25, 2024 · 7 comments
Open

Comments

@jackyjinjing
Copy link

调用evaluation脚本时每次准确率结果会有较大的差别,如下图所示,会出现这样子提示:The model and loaded state dict do not match exactly,帮忙看下是什么原因,模型是swin-transformer-v2-tiny
image
image

@Fafa-DL
Copy link
Owner

Fafa-DL commented Apr 25, 2024

可以将除改变图像大小的增强全部取消,readme顶部我有提及

@Fafa-DL
Copy link
Owner

Fafa-DL commented Apr 25, 2024

我看你截图怎么感觉没有用对权重啊,全都不匹配,记得修改对应配置文件调用权重

@jackyjinjing
Copy link
Author

可以将除改变图像大小的增强全部取消,readme顶部我有提及

image
应该不是这个导致的,训练之前已经按照readme里面的修改了

@jackyjinjing
Copy link
Author

我看你截图怎么感觉没有用对权重啊,全都不匹配,记得修改对应配置文件调用权重

image
是指这里的配置吗

@Fafa-DL
Copy link
Owner

Fafa-DL commented Apr 28, 2024

我看你截图怎么感觉没有用对权重啊,全都不匹配,记得修改对应配置文件调用权重

image 是指这里的配置吗

按道理如果是用自己训练的权重来评估不可能出现mismatch问题

@Fafa-DL
Copy link
Owner

Fafa-DL commented Apr 28, 2024

关于评估时每次有细微差别,因为图片与模型规定的输入尺寸不一致,使用的随机裁剪结果次次可能不同,从而导致了这个问题,在我理解来看数据量越少越明显,可以尝试的一个解决方法是预先将图片通过补边再等比缩放的方式处理成所要求的大小,这样可保证每次推理的数据一致

@jackyjinjing
Copy link
Author

我看你截图怎么感觉没有用对权重啊,全都不匹配,记得修改对应配置文件调用权重

image 是指这里的配置吗

按道理如果是用自己训练的权重来评估不可能出现mismatch问题

img_v3_02ac_0c2ee240-805b-409b-a597-d45dcf19edag
是不是预训练的权重加载有问题,训练的时候好像就报这个了

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

2 participants