wgetdd commited on
Commit
ecb6f27
1 Parent(s): 3c7f4df

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +1 -1
utils.py CHANGED
@@ -143,7 +143,7 @@ def get_gradcam(model,input_img, opacity,layer):
143
  print(layer_to_user)
144
  final_outputs,texts = [],[]
145
  for i in range(len(layer_to_user)):
146
- cam = GradCAM(model=model, target_layers=[layer_to_user[i]], use_cuda=True)
147
  grayscale_cam = cam(input_tensor=input_img, targets=targets)
148
  grayscale_cam = grayscale_cam[0, :]
149
  img = input_img.squeeze(0).to('cpu')
 
143
  print(layer_to_user)
144
  final_outputs,texts = [],[]
145
  for i in range(len(layer_to_user)):
146
+ cam = GradCAM(model=model, target_layers=[layer_to_user[i]], use_cuda=False)
147
  grayscale_cam = cam(input_tensor=input_img, targets=targets)
148
  grayscale_cam = grayscale_cam[0, :]
149
  img = input_img.squeeze(0).to('cpu')