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

在cuhk_sysu做完训练后使用demo.py推理结果不正确 #5

Open
axia75 opened this issue Jul 26, 2024 · 2 comments
Open

在cuhk_sysu做完训练后使用demo.py推理结果不正确 #5

axia75 opened this issue Jul 26, 2024 · 2 comments

Comments

@axia75
Copy link

axia75 commented Jul 26, 2024

感谢您提供重要的学习内容,有一个问题想请教,在cuhk_sysu做完训练后通过demo.py做推理的时候,结果不正确
result-1

result-2

训练了20轮
整个函数是不是需要做修改
image
我改为如下
def resume_from_ckpt11(ckpt_path, model, optimizer=None, lr_scheduler=None):
ckpt = torch.load(ckpt_path)
if 'model' in ckpt.keys():
ckpt = ckpt['model']

count = 0
miss = []
for i in ckpt:
    if 'backbone.swin' in i:          
        model.state_dict()[i].copy_(ckpt[i])          
        count += 1
    elif 'roi_heads.reid_head.swin' in i:
        model.state_dict()[i].copy_(ckpt[i])
        count += 1    
    else:
        miss.append(i)
print('%d loaded, %d missed:' %(count,len(miss)),miss)
return 0

不知道这么改对不对 或者应该怎么改

@axia75
Copy link
Author

axia75 commented Jul 26, 2024

resume_from_ckpt 是不是需要修改

@AlecDusheck
Copy link

#3 for weights. you train on top of the SOLDIER pre-trained model.

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