cycool29 commited on
Commit
7af2ec9
·
1 Parent(s): 8eea308
Files changed (2) hide show
  1. configs.py +2 -2
  2. extract.py +1 -1
configs.py CHANGED
@@ -44,8 +44,8 @@ LEARNING_RATE = 0.0001
44
  STEP_SIZE = 10
45
  GAMMA = 0.3
46
  CUTMIX_ALPHA = 0.3
47
- # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
48
- DEVICE = torch.device("cpu")
49
  NUM_PRINT = 100
50
  TASK = 1
51
  WARMUP_EPOCHS = 5
 
44
  STEP_SIZE = 10
45
  GAMMA = 0.3
46
  CUTMIX_ALPHA = 0.3
47
+ DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
48
+ # DEVICE = torch.device("cpu")
49
  NUM_PRINT = 100
50
  TASK = 1
51
  WARMUP_EPOCHS = 5
extract.py CHANGED
@@ -59,7 +59,7 @@ def extract_gradcam(image_path=None, save_path=None):
59
  input_tensor = input_tensor.to(DEVICE)
60
 
61
  # Create a GradCAMPlusPlus object
62
- cam = GradCAMPlusPlus(model=model, target_layers=[target_layer], use_cuda=True)
63
 
64
  # Generate the GradCAM heatmap
65
  grayscale_cam = cam(input_tensor=input_tensor)[0]
 
59
  input_tensor = input_tensor.to(DEVICE)
60
 
61
  # Create a GradCAMPlusPlus object
62
+ cam = GradCAMPlusPlus(model=model, target_layers=[target_layer])
63
 
64
  # Generate the GradCAM heatmap
65
  grayscale_cam = cam(input_tensor=input_tensor)[0]