diff --git a/cellpose/gui/gui.py b/cellpose/gui/gui.py index 2ee9dafe..ec1c6c86 100644 --- a/cellpose/gui/gui.py +++ b/cellpose/gui/gui.py @@ -2160,7 +2160,8 @@ def train_model(self, restore=None, normalize_params=None): model_type = None self.logger.info(f"training new model starting from scratch") self.current_model = model_type - self.channels = self.get_channels() + self.channels = self.training_params["channels"] + self.logger.info( f"training with chan = {self.ChannelChoose[0].currentText()}, chan2 = {self.ChannelChoose[1].currentText()}" ) @@ -2198,7 +2199,7 @@ def train_model(self, restore=None, normalize_params=None): self.logger.info(f">>>> diameter set to diam_labels ( = {diam_labels: 0.3f} )") self.restore = restore self.set_normalize_params(normalize_params) - self.get_next_image(load_seg=True) + self.get_next_image(load_seg=False) self.compute_segmentation(custom=True) self.logger.info( diff --git a/cellpose/gui/guiparts.py b/cellpose/gui/guiparts.py index 30d3979b..be73f634 100644 --- a/cellpose/gui/guiparts.py +++ b/cellpose/gui/guiparts.py @@ -236,7 +236,7 @@ def __init__(self, parent, model_strings): yoff += 1 use_SGD = "SGD" self.useSGD = QCheckBox(f"{use_SGD}") - self.useSGD.setToolTip("use SGD, if unchecked uses AdamW (recommended learning_rate then 1e-3)") + self.useSGD.setToolTip("use SGD, if unchecked uses AdamW (recommended learning_rate then 0.001)") self.useSGD.setChecked(True) self.l0.addWidget(self.useSGD, i+yoff, 1, 1, 1) @@ -285,10 +285,6 @@ def __init__(self, parent, model_strings): self.l0.addWidget(qlabel, i + 1, 5, 1, 1) def accept(self, parent): - # set channels - for i in range(2): - parent.ChannelChoose[i].setCurrentIndex( - self.ChannelChoose[i].currentIndex()) # set training params parent.training_params = { "model_index": self.ModelChoose.currentIndex(), @@ -297,6 +293,8 @@ def accept(self, parent): "n_epochs": int(self.edits[2].text()), "model_name": self.edits[3].text(), "SGD": True if self.useSGD.isChecked() else False, + "channels": [self.ChannelChoose[0].currentIndex(), + self.ChannelChoose[1].currentIndex()], #"use_norm": True if self.use_norm.isChecked() else False, } self.done(1)