Skip to content

Commit 57fa18e

Browse files
authored
Merge pull request #39 from sarthakpati/master
2 parents 16811ae + 6b3b939 commit 57fa18e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

GANDLF/training_loop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ def trainingLoop(trainingDataFromPickle, validationDataFromPickle, headers, devi
167167
dice_weights_dict[i] = dice_weights_dict[i] + currentNumber # class-specific non-zero voxels
168168
total_nonZeroVoxels = total_nonZeroVoxels + currentNumber # total number of non-zero voxels to be considered
169169

170-
170+
if total_nonZeroVoxels == 0:
171+
raise RuntimeError('Trying to train on data where every label mask is background class only.')
172+
171173
# dice_weights_dict_temp = deepcopy(dice_weights_dict)
172174
dice_weights_dict = {k: (v / total_nonZeroVoxels) for k, v in dice_weights_dict.items()} # divide each dice value by total nonzero
173175
dice_penalty_dict = deepcopy(dice_weights_dict) # deep copy so that both values are preserved

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
setup(
3636
name='GANDLF',
37-
version='0.0.8-dev', # NR: non-release; this should be changed when tagging
37+
version='0.0.8', # NR: non-release; this should be changed when tagging
3838
author="Ujjwal Baid, Megh Bhalerao, Caleb Grenko, Sarthak Pati, Siddhesh Thakur", # alphabetical order
3939
author_email='[email protected]',
4040
python_requires='>=3.6',

0 commit comments

Comments
 (0)