瀏覽代碼

Common `is_coco` logic betwen train.py and val.py (#5521)

modifyDataloader
Glenn Jocher GitHub 2 年之前
父節點
當前提交
bcc085d83f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      train.py

+ 1
- 1
train.py 查看文件

@@ -107,7 +107,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
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
is_coco = data.endswith('coco.yaml') and nc == 80 # COCO dataset
is_coco = isinstance(val_path, str) and val_path.endswith('coco/val2017.txt') # COCO dataset

# Model
check_suffix(weights, '.pt') # check weights

Loading…
取消
儲存