Sharpiless/Yolov5-deepsort-inference

为什么会有这个问题?

HLKunn opened this issue · 2 comments

Traceback (most recent call last):
File "E:/TuXiangChuLi/week14/Yolov5-deepsort-inference/demo.py", line 1, in
from AIDetector_pytorch import Detector
File "E:\TuXiangChuLi\week14\Yolov5-deepsort-inference\AIDetector_pytorch.py", line 6, in
from utils.BaseDetector import baseDet
File "E:\TuXiangChuLi\week14\Yolov5-deepsort-inference\utils\BaseDetector.py", line 1, in
from tracker import update_tracker
File "E:\TuXiangChuLi\week14\Yolov5-deepsort-inference\tracker.py", line 8, in
cfg.merge_from_file("E:/TuXiangChuLi/week14/Yolov5-deepsort-inference/deep_sort/configs/deep_sort.yaml")
File "E:\TuXiangChuLi\week14\Yolov5-deepsort-inference\deep_sort\utils\parser.py", line 23, in merge_from_file
self.update(yaml.load(fo.read()))
TypeError: load() missing 1 required positional argument: 'Loader'

Process finished with exit code 1

我也是这个问题

yaml 5.1版本后弃用了yaml.load(file)这个用法,因为觉得不安全,5.1之后的版本修改了需要指定Loader,通过默认加载​​器(FullLoader)禁止执行任意函数
解决方法:直接在读取yaml文件代码的后面加上 yaml.load(input, Loader=yaml.FullLoader)