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

请问有什么办法增加建筑物变化检测的泛化能力吗 #37

Open
funny000 opened this issue Feb 26, 2024 · 6 comments
Open

Comments

@funny000
Copy link

现在想到一种方法是合并levir-cd数据和whu-building cd数据,用于训练变检模型,这种办法可行吗?
另外您写的模型训练怎么设置单机多卡训练的?

@Bobholamovic
Copy link
Owner

你好!

  1. 扩充数据集是一种常用的方法,我认为这在一定程度上可以提升训练出来的模型的泛化能力。
  2. 这个repo只支持单机单卡训练~

@funny000
Copy link
Author

好的,了解了,
另外我想保存网络+权重这样的文件,在train.py文件的trainer后面加了些语句,但是报错了,是哪里没写对吗
`args = parse_args(parser_configurator)
trainer = RTrainer_switcher

print(trainer.model)
p2vnet = trainer.model
model_dir = "model_best_p2vnet.pth"
state = torch.load(model_dir)
p2vnet.load_state_dict(state)
torch.save(p2vnet, "p2vnet.pth")
exit(1)`

@Bobholamovic
Copy link
Owner

具体是什么错误呢

@funny000
Copy link
Author

image

报错信息是missing key(s) in state_dict:

@funny000
Copy link
Author

加载权重后,用模型的load_state_dict方法加载权重参数进模型,有不匹配的key

@Bobholamovic
Copy link
Owner

看起来model_best_p2vnet.pth中的内容和trainer.model并不匹配,所以不能直接加载~建议把trainer.model的state dict的key也打印出来,对比看看

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