YOLOV5出现.acceptable suffix is [‘.pt‘]的错误||不使用权重报错

YOLOV5 5.0版本及以前 如果训练自己的数据集不使用预训练权重 会报错.acceptable suffix is ['.pt'] 解决办法 找到general.py里的check_suffix函数,用下面的代码替换:

def check_suffix(file='yolov5s.pt', suffix=('.pt',), msg=''):
    # Check file(s) for acceptable suffix
    if file and suffix:
        if isinstance(suffix, str):
            suffix = [suffix]
        for f in file if isinstance(file, (list, tuple)) else [file]:
            s = Path(f).suffix.lower()  # file suffix
            if len(s):
                assert s in suffix, f"{msg}{f} acceptable suffix is {suffix}"

你可能感兴趣的:(人工智能,深度学习,神经网络)