Update script headers (#4163)

* Update download script headers

* cleanup

* bug fix attempt

* bug fix attempt2

* bug fix attempt3

* cleanup
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-07-26 15:23:33 +02:00
1 parent f8e11483df
commit 0ad6301c96
9 files changed
+36 -32

No files matched your search

+3 -2
View File
@@ -78,8 +78,9 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
plots = not evolve # create plots
cuda = device.type != 'cpu'
init_seeds(1 + RANK)
with open(data) as f:
data_dict = yaml.safe_load(f) # data dict
with open(data, encoding='ascii', errors='ignore') as f:
data_dict = yaml.safe_load(f)
nc = 1 if single_cls else int(data_dict['nc']) # number of classes
names = ['item'] if single_cls and len(data_dict['names']) != 1 else data_dict['names'] # class names
assert len(names) == nc, f'{len(names)} names found for nc={nc} dataset in {data}' # check