BiaPyX / BiaPy

Open source Python library for building bioimage analysis pipelines
https://BiaPyX.github.io
MIT License
123 stars 28 forks source link

Fix bug in base_workflow.py #64

Closed gnodar01 closed 7 months ago

gnodar01 commented 7 months ago

Received the following traceback in BiaPy_2D_instance_Segmentation.ipynb (did not modify the code in the notebook in any way), which prevented the training and inference from completing correctly:

Traceback (most recent call last):
  File "/content/BiaPy/main.py", line 51, in <module>
    _biapy.run_job()
  File "/content/BiaPy/biapy/_biapy.py", line 415, in run_job
    self.test()
  File "/content/BiaPy/biapy/_biapy.py", line 159, in test
    self.workflow.test()
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/content/BiaPy/biapy/engine/base_workflow.py", line 823, in test
    self.process_sample(norm=(X_norm, Y_norm))                        
  File "/content/BiaPy/biapy/engine/instance_seg.py", line 514, in process_sample
    super().process_sample(norm)
  File "/content/BiaPy/biapy/engine/base_workflow.py", line 1353, in process_sample
    if isinstance(p, list):
UnboundLocalError: local variable 'p' referenced before assignment
gnodar01 commented 7 months ago

Same bug also exist when I try to run the workflow yaml file generated in the notebook, but in the GUI:

Screenshot 2024-02-21 at 12 11 47 PM Screenshot 2024-02-21 at 12 12 11 PM
danifranco commented 7 months ago

Thank you so much for correcting the typo!