From 16613743fe8d4dfa5de8ce8c1c6612957fdb19e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 May 2024 09:10:02 -0400 Subject: [PATCH] fixing train bug (#940) --- cellpose/io.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cellpose/io.py b/cellpose/io.py index 595d931c..6d76f0df 100644 --- a/cellpose/io.py +++ b/cellpose/io.py @@ -423,7 +423,8 @@ def load_images_labels(tdir, mask_filter="_masks", image_filter=None, labels = [] k = 0 for n in range(nimg): - if os.path.isfile(label_names[n]) or os.path.isfile(flow_names[0]): + if (os.path.isfile(label_names[n]) or + (flow_names is not None and os.path.isfile(flow_names[0]))): image = imread(image_names[n]) if label_names is not None: label = imread(label_names[n])