ivadomed / ivadomed

Repository on the collaborative IVADO medical imaging project between the Mila and NeuroPoly labs.
https://ivadomed.org
MIT License
155 stars 150 forks source link

issue with two-class segmentation: ValueError: operands could not be broadcast together with shapes (744,1154,2) (4,) #1311

Closed chennyyuee closed 9 months ago

chennyyuee commented 9 months ago

Hi,

Issue description

I'm running the tutorial Two-class segmentation to train a model for use in AxonDeepSeg. But when I run ivadomed -c config_microscopy.json, I got the following error massage:

  File "C:\Users\ct630\ivadomed_env\lib\site-packages\ivadomed\loader\segmentation_pair.py", line 297, in read_file
    img = self.convert_file_to_nifti(filename, extension, is_gt)
  File "C:\Users\ct630\ivadomed_env\lib\site-packages\ivadomed\loader\segmentation_pair.py", line 360, in convert_file_to_nifti
    _img = np.sum(_img * (.299, .587, .114, 0), axis=-1)
ValueError: operands could not be broadcast together with shapes (744,1154,2) (4,)

Is there a way to solve this problem? Many thanks!

Current behavior

Expected behavior

### Steps to reproduce

Environment

System description

Windows

Installed packages

Output of pip freeze ``` ```
kanishk16 commented 9 months ago

Closing as duplicate of #1312