model.yaml nc inherited from dataset.yaml

This commit is contained in:
Glenn Jocher committed 2020-07-04 17:51:54 -07:00
1 parent 1fdaa4987b
commit bb3c346916
2 files changed
+3 -3

No files matched your search

+1 -2
View File
@@ -77,8 +77,7 @@ def train(hyp):
os.remove(f)
# Create model
model = Model(opt.cfg).to(device)
assert model.md['nc'] == nc, '%s nc=%g classes but %s nc=%g classes' % (opt.data, nc, opt.cfg, model.md['nc'])
model = Model(opt.cfg, nc=data_dict['nc']).to(device)
# Image sizes
gs = int(max(model.stride)) # grid size (max stride)