ONNX compatibility updates

This commit is contained in:
Glenn Jocher 2018-12-28 21:12:31 +01:00
parent d1951c1868
commit cc018c73ad
1 changed files with 3 additions and 3 deletions

View File

@ -22,9 +22,9 @@ def load_classes(path):
"""
Loads class labels at 'path'
"""
fp = open(path, 'r')
names = fp.read().split('\n')[:-1]
return names
fp = open('data/coco.names', 'r')
names = fp.read().split('\n')
return list(filter(None, names)) # filter removes empty strings (such as last line)
def model_info(model): # Plots a line-by-line description of a PyTorch model