我有一批形状为[5,1,100,100]( batch_size x dims x ht x wd)的分割掩码,我必须在 tensorboardX 中使用 RGB 图像批次显示它们[5,3,100,100]。我想在分割掩码的第二个轴上添加两个虚拟维度以使其[5,3,100,100]在将其传递给torch.utils.make_grid. 我曾尝试unsqueeze,expand并view但我不能够做到这一点。有什么建议?
[5,1,100,100]
batch_size x dims x ht x wd
[5,3,100,100]
torch.utils.make_grid
unsqueeze
expand
view
python-3.x tensorboard pytorch
python-3.x ×1
pytorch ×1
tensorboard ×1