Can the image size only be 1024?
When I try to change the image size, it gives the following error:
Traceback (most recent call last):
File "model_proxy_SAM.py", line 396, in
out = model(x)
File "/public2/zhongyutian/zhongyutian/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "model_proxy_SAM.py", line 322, in forward
out = self.sam.image_encoder(x)
File "/public2/zhongyutian/zhongyutian/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/public2/zhongyutian/AutoSAM-main/mobilemodels/mobile_encoder/tiny_vit_sam.py", line 617, in forward
x = self.forward_features(x)
File "/public2/zhongyutian/AutoSAM-main/mobilemodels/mobile_encoder/tiny_vit_sam.py", line 609, in forward_features
x = layer(x)
File "/public2/zhongyutian/zhongyutian/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/public2/zhongyutian/AutoSAM-main/mobilemodels/mobile_encoder/tiny_vit_sam.py", line 439, in forward
x = blk(x)
File "/public2/zhongyutian/zhongyutian/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/public2/zhongyutian/AutoSAM-main/mobilemodels/mobile_encoder/tiny_vit_sam.py", line 336, in forward
assert L == H * W, "input feature has wrong size"
AssertionError: input feature has wrong size
@zhongniuniu hi, bro. Did you solve the problem? I also want to segment the different sizes of the images.
I still can't enter an image with a size other than 1024. I had to resize my individual image to 1024 to run it successfully.