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

如何用自己的灰度图数据集进行训练?🥲 #41

Open
NCUCyy opened this issue Mar 26, 2024 · 2 comments
Open

如何用自己的灰度图数据集进行训练?🥲 #41

NCUCyy opened this issue Mar 26, 2024 · 2 comments

Comments

@NCUCyy
Copy link

NCUCyy commented Mar 26, 2024

我的数据集是(1,256,256)的灰度图,在训练DACLIP的时候会报如下的错误:🥲🥲🥲

我把如下路径中的conv1中的in_channel从3改为了1
image

image

结果会报错:
RuntimeError: Error(s) in loading state_dict for CLIP: size mismatch for visual.conv1.weight: copying a param with shape torch.Size([768, 3, 32, 32]) from checkpoint, the shape in current model is torch.Size([768, 1, 32, 32]).

请问如何解决呀?

@Algolzw
Copy link
Owner

Algolzw commented Mar 26, 2024

你好我建议不要修改网络哈最好可以在加载图像时把gray转化为RGB(当然看起来还是灰度图),比如在这里加一个.convert('RGB')

@gejutaixiao22
Copy link

您好,我也在用daclip训练灰度图,能交流一下具体的细节么。非常感谢

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

3 participants