BBillot/SynthSeg

Issues with the tutorials

Closed this issue · 6 comments

Hello,

I am trying to run the tutorials module to become familiar with the code. However, I have an error.
I am typing the command python 1-generation_visualisation.py and I have an error which is AttributeError: 'BrainGenerator' object has no attribute 'subjects_prob'.
Could you help me to understand the mistake ?

Thank you for your answer.

In fact, the attribute subjects_prob does not seem to be optional and cannot be equal to None.
I had the same error when I was running training.py

Hello,
when is the last time you pulled the code ? there has been some problems with subjects_prob in the past, but it works all right on my machine with the latest version.

2 weeks ago I think and it seems I got the last one because I cannot pull.
Actually I still have issues with the training. I just did a little training to see how it works. I did the command
python scripts/commands/training.py data/training_label_maps/training_seg_01.nii.gz model_test. I changed the subjects_prob default value into 1 and I have got 2 file : dice_001.h5 and wl2_001.h5
Then I tried to run a predict with this model. So I have modified the path of the model in SynthSeg_predict.py.
However, there is an error which is Value error: axes don't match array

Do you know what the problem could be ?

Thanks for your answer

I am having this problem too and I just cloned the repository (python 1-generation_visualisation.py and I have an error which is AttributeError: 'BrainGenerator' object has no attribute 'subjects_prob'.) Is there any solution?

I have just added "self.subjects_prob = None" before line 207 in SynthSeg/brain_generator.py and it worked.

Sorry it took me such a long time to answer....
Anyway I now understand where the problem is coming from.

I can see that adding "self.subjects_prob = None" before line 207 fixes the problem (as @joseabernal suggeted), but then it overrides subject_prob if you ever use it.
The proper way to fix this is to add an "else" statement at line 212:

    else:
        self.subjects_prob = None

I'll push this in a short time. Sorry for the inconvenience, but I still hope you were able to use SynthSeg !