I am working with a tensor shape ([1,9]) and passing it as a tuple of bath size:2.
I am unable to pass the right sliding window shape for Occlusion Model.
Can you help me to know what would be the ideal input for sliding window shape and stride?
A snippet of my Occlusion model is here:
clinical=torch.stack(tuple(clinical), dim=1) #torch.Size([2, 9])
print(clinical.shape)
clinical = clinical[:, :].detach().cpu().numpy()
ablator = Occlusion(model)
attr = ablator.attribute(tuple(clinical), target=ds_item[‘Class’], sliding_window_shapes=(2,9))
occ_sens = OcclusionSensitivity(nn_module=my_model, n_batch=1, stride=(2,2))
occ_map, most_probable_class = occ_sens(clinical,
b_box=[-1, -1, 2, 3, -1, -1, -1, -1])
print(occ_map)
Error message:
in _format_and_verify_sliding_window_shapes
assert len(sliding_window_shapes) == len(
AssertionError: Must provide sliding window dimensions for each input tensor.