fitushar / 3D-GuidedGradCAM-for-Medical-Imaging

This Repo containes the implemnetation of generating Guided-GradCAM for 3D medical Imaging using Nifti file in tensorflow 2.0. Different input files can be used in that case need to edit the input to the Guided-gradCAM model.
99 stars 7 forks source link

ValueError: not enough values to unpack (expected 2, got 1) #5

Open ssk-28 opened 2 years ago

ssk-28 commented 2 years ago

Hello, I am trying to apply the gradcam inspired by your code to my resnet3D model. I keep getting error while calculating the Gradients in the following line :

conv_outputs, predictions = grad_model(input_pet_io)

error: ValueError: not enough values to unpack (expected 2, got 1)

I want to know why and how exactly conv_outputs is used in this line ?

thank you ~

fitushar commented 2 years ago

Please check this function on the same script which wraps the ROI CNN model to an expected grad model.

https://github.com/fitushar/3D-GuidedGradCAM-for-Medical-Imaging/blob/09f203cae811476c0f2380894722b20628b97b7e/guided_Gradcam3.py#L56

Here is the model architecture that I used for this example: https://github.com/fitushar/3D-GuidedGradCAM-for-Medical-Imaging/blob/09f203cae811476c0f2380894722b20628b97b7e/Resnet_3D.py