Skip to content

Commit

Permalink
Add missing unsqueeze
Browse files Browse the repository at this point in the history
  • Loading branch information
pchlap committed Dec 6, 2023
1 parent c8ec57e commit 0ddb078
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platipy/imaging/cnn/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,10 @@ def validation_step(self, batch, _):
)
np.save(mask_file, y[s].cpu().numpy())

# Image will be same for all in batch
# Image (and context map) will be same for all in batch
x = x[0].unsqueeze(0)
if c is not None:
c = c[0].unsqueeze(0)
if self.hparams.ndims == 2:
vis = ImageVisualiser(sitk.GetImageFromArray(x.to("cpu")[0]), axis="z")
else:
Expand Down

0 comments on commit 0ddb078

Please sign in to comment.