Unverified 提交 850970e0 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

`feature_visualization()` CUDA fix (#3925)

上级 588094eb
...@@ -461,7 +461,7 @@ def feature_visualization(x, module_type, stage, n=64, save_dir=Path('runs/detec ...@@ -461,7 +461,7 @@ def feature_visualization(x, module_type, stage, n=64, save_dir=Path('runs/detec
f = f"stage{stage}_{module_type.split('.')[-1]}_features.png" # filename f = f"stage{stage}_{module_type.split('.')[-1]}_features.png" # filename
plt.figure(tight_layout=True) plt.figure(tight_layout=True)
blocks = torch.chunk(x[0], channels, dim=0) # select batch index 0, block by channels blocks = torch.chunk(x[0].cpu(), channels, dim=0) # select batch index 0, block by channels
n = min(n, channels) # number of plots n = min(n, channels) # number of plots
ax = plt.subplots(math.ceil(n / 8), 8, tight_layout=True)[1].ravel() # 8 rows x n/8 cols ax = plt.subplots(math.ceil(n / 8), 8, tight_layout=True)[1].ravel() # 8 rows x n/8 cols
for i in range(n): for i in range(n):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论