-
Notifications
You must be signed in to change notification settings - Fork 91
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
RuntimeError: The size of tensor a (32) must match the size of tensor b (64) at non-singleton dimension 2 #46
Comments
我输入的图像尺寸设置为512,但是报错为RuntimeError: The size of tensor a (32) must match the size of tensor b (64) at non-singleton dimension 2,查了一下,发现SAM模型本身的输入就是1024,那怎么训练其他尺寸的数据呢?是硬padding为1024吗? |
sam源码中的sam.py有一个process函数是这样直接padding的,感觉训练应该也是吧 |
The sam.py in the sam source code has a process function that directly pads in this way. I feel that the training should be the same. |
yes, you need to change some hyper-parameters to train image with other sizes. if you want to solve it in preprocessing, I will recommend resize, instead of padding. |
Thank you! I will follow the method you suggested! |
So this still mean resizing the image to 1024? |
所以是重新训练的吗 |
image resolution now can be resized, just set -image_size parameter in the running. check my newest update. |
Is the input image size of the SAM model fixed at 1024? It seems that an error occurs when inputting images of other sizes. I tried using a 512-sized image and it resulted in a RuntimeError: The size of tensor a (32) must match the size of tensor b (64) at non-singleton dimension 2.
The text was updated successfully, but these errors were encountered: