brain_segmentation icon indicating copy to clipboard operation
brain_segmentation copied to clipboard

Segmentation_Models.py IndexError: list index out of range

Open jacob5412 opened this issue 6 years ago • 0 comments

On running the Segmentation_Models.py file I get the following error: System: Mac Keras: 1.0.0 Tensorflow: 0.12.0

Jacobs-MacBook-Pro:code jacobjohn$ python Segmentation_Models.py 
Using TensorFlow backend.
Finding patches of class 0...                                                                      ]  0% 
Traceback (most recent call last):
  File "Segmentation_Models.py", line 376, in <module>
    X,y = patches.make_training_patches()
  File "/Users/jacobjohn/Codes/brain_segmentation-master/code/patch_library.py", line 155, in make_training_patches
    p, l = self.find_patches(classes[i], per_class)
  File "/Users/jacobjohn/Codes/brain_segmentation-master/code/patch_library.py", line 45, in find_patches
    im_path = random.choice(self.train_data)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 277, in choice
    return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
IndexError: list index out of range

jacob5412 avatar Oct 17 '18 09:10 jacob5412