Added assert to data loader (checking label smoothing works)

This commit is contained in:
Marcel Simon 2019-08-31 08:02:27 +00:00
Родитель e97d8372e9
Коммит c8a4eb5d3f
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -346,6 +346,10 @@ class JSONDataset(data.Dataset):
if (dataFormat2017):
# self.tax_levels = ['id', 'name', 'supercategory']
self.tax_levels = ['id', 'name']
if label_smoothing > 0:
assert len(self.tax_levels) == 3, "Please comment in the line above to include the taxonomy " + \
"level 'supercategory' in order for label smoothing to work. It should look like this: " + \
"self.tax_levels = ['id', 'name', 'supercategory']"
else:
self.tax_levels = ['id', 'genus', 'family', 'order', 'class', 'phylum', 'kingdom']
#8142, 4412, 1120, 273, 57, 25, 6