Hi,
My designed network is 3D CNN followed by RNN.
I am trying to use M3D-Cam to get attention maps from the last convolution layer of the proposed network however I get the following error. Kindly have a look and guide me how can I achieve it
model = 3DCNN_RNN().to(device)
weights_pth = 'trained_weights'
model.load_state_dict(torch.load(weights_pth))
save_pth = 'model_att_maps/'
Hi, My designed network is 3D CNN followed by RNN.
I am trying to use M3D-Cam to get attention maps from the last convolution layer of the proposed network however I get the following error. Kindly have a look and guide me how can I achieve it
model = 3DCNN_RNN().to(device) weights_pth = 'trained_weights' model.load_state_dict(torch.load(weights_pth)) save_pth = 'model_att_maps/'
model_c = medcam.inject(model, backend='gcam', replace = True, label = 1 ,layer = 'conv4') modelc.eval() for (img1, , label) in train_dataloader:
img_vol = img1.unsqueeze(1)
img_cuda = img_vol.float().to(device) output = model_c(img_cuda)
break
I get the following error
<< ======================================================>>
RuntimeError Traceback (most recent call last)