-
Notifications
You must be signed in to change notification settings - Fork 7
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
cls_head 计算特征时维度不匹配? #16
Comments
你好,请问问题解决了吗? |
这个问题我测试过了,用我上传的处理好的数据没有问题,应该是做数据这一部分我在整理的时候shape不一致导致的。 Line 27 in aab6cdb
加上一两行就好了。 |
PseCo/fsc147/4_1_train_roi_head.py
Line 277 in 0192ee5
我在跑这行代码的时候总是会遇到embeddings和prompts特征维度不匹配的问题,导致
PseCo/models.py
Line 25 in 0192ee5
这里无法直接矩阵乘
比如:
PseCo/fsc147/4_1_train_roi_head.py
Line 277 in 0192ee5
时,embeddings 和 prompts.unsqueeze(1) 的shape 分别是 torch.Size([8192, 3, 512]) torch.Size([8192, 1, 3, 512]) ,这样直接计算会显存爆炸,需要384G ** 我试过把prompts.unsqueeze(1) 去掉unsqueeze(1) ,这样不报显存OOM的bug了,但是下面的代码会报错:
PseCo/fsc147/4_1_train_roi_head.py
Line 283 in 0192ee5
时,embeddings 和 prompts的shape是torch.Size([1536, 3, 512]) torch.Size([1536, 512]),这时候就会有
RuntimeError: The size of tensor a (3) must match the size of tensor b (1536) at non-singleton dimension 1
。此时如果加上prompts.unsqueeze(1)就不会报错了所以,是否是代码历史版本的问题?有无最新版的可行代码呀?
The text was updated successfully, but these errors were encountered: