Skip to content

Commit 38dfb1d

Browse files
fix #1338
1 parent 3f13617 commit 38dfb1d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cellpose/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ def _reshape_norm(data, channel_axis=None, normalize_params={"normalize": False}
7272
# put channel axis first
7373
td = np.moveaxis(td, channel_axis0, 0)
7474
td = td[:3] # keep at most 3 channels
75-
if td.ndim == 2 or (td.ndim == 3 and td.shape[0] == 1):
75+
if td.ndim == 2:
7676
td = np.stack((td, 0*td, 0*td), axis=0)
7777
elif td.ndim == 3 and td.shape[0] < 3:
78-
td = np.concatenate((td, 0*td[:1]), axis=0)
78+
td = np.concatenate((td, np.zeros((3 - td.shape[0], *td.shape[1:]), dtype=td.dtype)), axis=0)
7979
data_new.append(td)
8080
data = data_new
8181
if normalize_params["normalize"]:

0 commit comments

Comments
 (0)