This commit is contained in:
Glenn Jocher 2019-05-14 12:59:12 +02:00
parent e42278e981
commit 4b15644b46
1 changed files with 3 additions and 3 deletions

View File

@ -31,9 +31,9 @@ def init_seeds(seed=0):
def load_classes(path):
# Loads class labels at 'path'
fp = open(path, 'r')
names = fp.read().split('\n')
# Loads *.names file at 'path'
with open(path, 'r') as f:
names = f.read().split('\n')
return list(filter(None, names)) # filter removes empty strings (such as last line)