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

训练在自己的数据集上shape形状不匹配 #14

Open
yjdzyr opened this issue Jun 11, 2024 · 1 comment
Open

训练在自己的数据集上shape形状不匹配 #14

yjdzyr opened this issue Jun 11, 2024 · 1 comment

Comments

@yjdzyr
Copy link

yjdzyr commented Jun 11, 2024

作者,您好!非常感谢您提供的这个优秀的代码,我在自己的数据集上训练的时候发现一些问题,有一些层无法正确加载,我看了一下应该是类别数不同,我也尝试改变代码中的num_class,这个问题依旧没有解决。

还有一个警告就是在我自己的使用的一个模块,显示没有weight和bias,请问这两个问题如何解决呢,非常期待您的回复

001adf3179e2bbe083b58ad33deffa3

@xiuqhou
Copy link
Owner

xiuqhou commented Jun 12, 2024

如果是训练自己的数据集,由于类别不同,通常不需要为分类层加载已有的权重;另外,您好像是为网络增加了自己定义的层,所以这部分层也不会加载权重。图片中missing key: xxx.weight, xxx.bias并不是指网络没有这个模块,而是这个模块没有加载对应的权重。

因此图片中是正常情况,继续训练就可以了。

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