DiamondLightSource / SuRVoS

(Su)per (R)egion (Vo)lume (S)egmentaton workbench
Apache License 2.0
25 stars 5 forks source link

Crash when predicting on reopened workspace #61

Closed OllyK closed 5 years ago

OllyK commented 5 years ago

SuRVoS with Python 3.6 and PyQT 5.9.7

Prediction works fine when using a fresh workspace. When a workspace is created and reloaded however, SuRVoS crashes when trying to Predict labels:

Level {'level': 0, 'plevel': None, 'plabel': -1}
Desc {'supervoxels': 'supervoxels/supervoxels', 'features': ['channels/1_tv'], 'projection': 'None', 'desc_type': 'Mean', 'desc_bins': 10, 'nh_order': '0', 'sp_edges': 'supervoxels/graph_edges'}
Clf {'clf': 'ensemble', 'type': 'rf', 'n_estimators': 100, 'max_depth': None, 'learning_rate': 1.0, 'subsample': 1.0, 'n_jobs': 1}
Ref {'ref_type': 'None', 'lambda': 50.0, 'features': [], 'sp_edges': 'supervoxels/graph_edges', 'sp_eweights': 'supervoxels/graph_edge_weights'}
annotations/annotations0 None
predictions/predictions predictions/confidence

### Predicting labels for Level 0 ###

### predict_proba ###
+ Extracting descriptors: {'supervoxels': 'supervoxels/supervoxels', 'features': ['channels/1_tv'], 'projection': 'None', 'desc_type': 'Mean', 'desc_bins': 10, 'nh_order': '0', 'sp_edges': 'supervoxels/graph_edges'}
+ Reserving memory for 1 features
    * Loading feature channels/1_tv
+ Loading supervoxels
+ Computing descriptors: Mean (10)
+ Creating classifier: {'clf': 'ensemble', 'type': 'rf', 'n_estimators': 100, 'max_depth': None, 'learning_rate': 1.0, 'subsample': 1.0, 'n_jobs': 1}
+ Loading labels
+ Extracting supervoxel labels
+ Training classifier
+ Predicting labels
+ Extracting probabilities
+ Measuring uncertainty
+ Mapping predictions back to pixels
+ Saving results to disk
Traceback (most recent call last):
  File "/dls_sw/apps/SuRVoS_2019/miniconda/envs/build-environment/lib/python3.6/site-packages/survos/plugins/training.py", line 468, in on_level_predicted
    self.select_level(idx)
  File "/dls_sw/apps/SuRVoS_2019/miniconda/envs/build-environment/lib/python3.6/site-packages/survos/plugins/training.py", line 520, in select_level
    labelobj = UncertainLabelWidget(label.idx, label.name, label.color)
  File "/dls_sw/apps/SuRVoS_2019/miniconda/envs/build-environment/lib/python3.6/site-packages/survos/plugins/training.py", line 414, in __init__
    self.name = BLabel(name)
  File "/dls_sw/apps/SuRVoS_2019/miniconda/envs/build-environment/lib/python3.6/site-packages/survos/widgets/base.py", line 560, in __init__
    super(BLabel, self).__init__(*args, **kwargs)
TypeError: arguments did not match any overloaded call:
  QLabel(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()): argument 1 has unexpected type 'numpy.bytes_'
  QLabel(str, parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()): argument 1 has unexpected type 'numpy.bytes_'
Aborted