Skip to content

Commit

Permalink
bug with min_train_masks
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Sep 14, 2024
1 parent 10d3554 commit 52f75f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cellpose/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def _process_train_test(train_data=None, train_labels=None, train_files=None,
if train_probs is not None:
train_probs = train_probs[ikeep]
diam_train = diam_train[ikeep]
nimg = len(train_data)

### normalize probabilities
train_probs = 1. / nimg * np.ones(nimg,
Expand Down Expand Up @@ -410,7 +411,7 @@ def train_seg(net, train_data=None, train_labels=None, train_files=None,
"channel_axis": channel_axis,
"rgb": rgb
}

net.diam_labels.data = torch.Tensor([diam_train.mean()]).to(device)

nimg = len(train_data) if train_data is not None else len(train_files)
Expand Down

0 comments on commit 52f75f9

Please sign in to comment.