Open amandalucasp opened 2 years ago
Hi @amandalucasp, thank you for the question! Do you get an error if you do a forward pass, i.e. linear_classifier(inp)
?
Hi @99warriors! I don't get any errors doing a forward pass, as I was able to successfully train my classifier.
I'm working with a multi-label image dataset. My inputs have the following shape:
torch.Size([3, 224, 224])
; and my targets are all 1x33 tensors one-hot encoded, as in the following example:tensor([0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], device='cuda:0')
I'm trying to use the LayerGradCam() in the following manner:
and keep getting the following error:
I'm currently trying to implement the solution proposed in https://github.com/pytorch/captum/issues/171 but I get a python error when trying to create the tuple.
The error I'm getting is that I cannot create a tuple using 2 arguments instead of 1.
I also tried passing the index to atributte():
In this case, I have an input of inp: torch.Size([1, 3, 224, 224]) and a target of torch.Size([1]). But then I get the same error I was getting on the first snippet of code.
Any suggestions on how to solve this?
Thanks!