提交 cb527d3a authored 作者: Glenn Jocher's avatar Glenn Jocher

new nc=len(names) check

上级 dd8e742e
...@@ -68,7 +68,8 @@ def train(hyp): ...@@ -68,7 +68,8 @@ def train(hyp):
data_dict = yaml.load(f, Loader=yaml.FullLoader) # model dict data_dict = yaml.load(f, Loader=yaml.FullLoader) # model dict
train_path = data_dict['train'] train_path = data_dict['train']
test_path = data_dict['val'] test_path = data_dict['val']
nc = 1 if opt.single_cls else int(data_dict['nc']) # number of classes nc, names = (1, ['item']) if opt.single_cls else (int(data_dict['nc']), data_dict['names']) # number classes, names
assert len(names) == nc, '%g names found for nc=%g dataset in %s' % (len(names), nc, opt.data) # check
# Remove previous results # Remove previous results
for f in glob.glob('*_batch*.jpg') + glob.glob(results_file): for f in glob.glob('*_batch*.jpg') + glob.glob(results_file):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论