File tree 1 file changed +14
-6
lines changed
src/napari_feature_classifier
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,7 @@ def __init__(
223
223
self ._last_selected_label_layer = get_selected_or_valid_label_layer (
224
224
viewer = self ._viewer
225
225
)
226
+
226
227
# Initialize the classifier
227
228
if classifier :
228
229
self ._classifier = classifier
@@ -659,12 +660,19 @@ def load(self):
659
660
with open (clf_path , "rb" ) as f : # pylint: disable=C0103
660
661
clf = pickle .load (f )
661
662
662
- self ._run_container = ClassifierRunContainer (
663
- self ._viewer ,
664
- clf ,
665
- classifier_save_path = clf_path ,
666
- auto_save = True ,
667
- )
663
+ try :
664
+ self ._run_container = ClassifierRunContainer (
665
+ self ._viewer ,
666
+ clf ,
667
+ classifier_save_path = clf_path ,
668
+ auto_save = True ,
669
+ )
670
+ except NotImplementedError :
671
+ napari_info (
672
+ "Create a label layer with a feature dataframe before loading "
673
+ "the classifier"
674
+ )
675
+ return
668
676
self .clear ()
669
677
self .append (self ._run_container )
670
678
You can’t perform that action at this time.
0 commit comments