ms2rescore icon indicating copy to clipboard operation
ms2rescore copied to clipboard

Logging bug in GUI in debug mode

Open RalfG opened this issue 1 year ago • 2 comments

In the GUI, in debug mode, keras tries to write its progress bar, but fails. In non-debug mode, this is not an issue, most likely due to the redirect to os.devnull. Perhaps in the GUI, we should always do this?

Stack trace:

'NoneType' object has no attribute 'write'
Traceback (most recent call last):
  File "ms2rescore\gui\function2ctk.py", line 301, in run
    self.fn(*self.fn_args, **self.fn_kwargs)
  File "ms2rescore\gui\app.py", line 809, in function
    rescore(configuration=config)
  File "ms2rescore\core.py", line 79, in rescore
    fgen.add_features(psm_list)
  File "ms2rescore\feature_generators\deeplc.py", line 155, in add_features
    self.deeplc_predictor.calibrate_preds(psm_list_calibration)
  File "deeplc\deeplc.py", line 1185, in calibrate_preds
    calibrate_output = self.calibrate_preds_func_pygam(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "deeplc\deeplc.py", line 819, in calibrate_preds_func_pygam
    predicted_tr = self.make_preds(psm_list, calibrate=False, mod_name=mod_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "deeplc\deeplc.py", line 741, in make_preds
    ret_preds = self.make_preds_core(
                ^^^^^^^^^^^^^^^^^^^^^
  File "deeplc\deeplc.py", line 612, in make_preds_core
    ret_preds = mod.predict(
                ^^^^^^^^^^^^
  File "keras\src\utils\traceback_utils.py", line 122, in error_handler
  File "keras\src\utils\traceback_utils.py", line 119, in error_handler
  File "keras\src\backend\tensorflow\trainer.py", line 514, in predict
  File "keras\src\callbacks\callback_list.py", line 126, in on_predict_batch_end
  File "keras\src\callbacks\progbar_logger.py", line 66, in on_predict_batch_end
  File "keras\src\callbacks\progbar_logger.py", line 95, in _update_progbar
  File "keras\src\utils\progbar.py", line 182, in update
  File "keras\src\utils\io_utils.py", line 98, in print_msg
AttributeError: 'NoneType' object has no attribute 'write'

RalfG avatar Sep 18 '24 15:09 RalfG

Hi, I am encountering this issue, do you have a temporary solution that I could try out? Thanks a lot.

nnalpas avatar Oct 03 '24 09:10 nnalpas

I found a solution based on the original issue, just need to run with log set to "info". Thanks.

nnalpas avatar Oct 03 '24 09:10 nnalpas