You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently running AdaPool2d as a replacement of MaxPool2d in Resnet's stem similar on how you did it in SoftPool. However, I keep on getting an assertionError in line 1325 as shown below:
assertisinstance(beta, tuple) ortorch.is_tensor(beta), 'Agument `beta` can only be initialized with Tuple or Tensor type objects and should correspond to size (oH, oW)'
Does this mean beta requires a fixed image size, e.g. (224,244)? Or is there a way to make it adaptive across varying image size (e.g. object detection)?
The text was updated successfully, but these errors were encountered:
The primary intention of beta (based also on the subsequent paper) was to use it as a regional-specific mask. So it should have the same size as the output tensor post-pooling (e.g. oH,oW).
However, if you expect to have inputs of different sizes, a way around this is to pass a Tuple or Tensor of size 1. This will essentially apply the same beta over the entire image. Although you lose the region-specific nature of the method, from some testing in my own projects, the difference in accuracy is not large.
So there are multiple ways to define beta, e.g.:
pool_2d_single=AdaPool2d(beta=(1,1)) # single beta parampool_2d_mask=AdaPool2d(beta=(oH,oW)) # beta mask of oH x oW
I'm currently running AdaPool2d as a replacement of MaxPool2d in Resnet's stem similar on how you did it in SoftPool. However, I keep on getting an assertionError in line 1325 as shown below:
Does this mean beta requires a fixed image size, e.g. (224,244)? Or is there a way to make it adaptive across varying image size (e.g. object detection)?
The text was updated successfully, but these errors were encountered: