glenn-jocher commited on
Commit
850970e
1 Parent(s): 588094e

`feature_visualization()` CUDA fix (#3925)

Browse files
Files changed (1) hide show
  1. utils/plots.py +1 -1
utils/plots.py CHANGED
@@ -461,7 +461,7 @@ def feature_visualization(x, module_type, stage, n=64, save_dir=Path('runs/detec
461
  f = f"stage{stage}_{module_type.split('.')[-1]}_features.png" # filename
462
 
463
  plt.figure(tight_layout=True)
464
- blocks = torch.chunk(x[0], channels, dim=0) # select batch index 0, block by channels
465
  n = min(n, channels) # number of plots
466
  ax = plt.subplots(math.ceil(n / 8), 8, tight_layout=True)[1].ravel() # 8 rows x n/8 cols
467
  for i in range(n):
 
461
  f = f"stage{stage}_{module_type.split('.')[-1]}_features.png" # filename
462
 
463
  plt.figure(tight_layout=True)
464
+ blocks = torch.chunk(x[0].cpu(), channels, dim=0) # select batch index 0, block by channels
465
  n = min(n, channels) # number of plots
466
  ax = plt.subplots(math.ceil(n / 8), 8, tight_layout=True)[1].ravel() # 8 rows x n/8 cols
467
  for i in range(n):