You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

运行DeepSORT_YOLOv5_Pytorch遇yaml.load报错及核心转储问题

Jetson TX2平台运行DeepSORT_YOLOv5_Pytorch报错排查

运行环境

  • 硬件:大疆Manifold 2G(搭载Nvidia Jetson TX2)
  • 软件:Python 3.8虚拟环境,已通过pip install -r requirements.txt安装项目全部依赖
  • 目标项目仓库:https://github.com/HowieMa/DeepSORT_YOLOv5_Pytorch

首次报错:YAML加载参数缺失

运行命令python main.py --cam 0 --display时出现如下报错:

$ python main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU

Using webcam 0
Traceback (most recent call last):
  File "main.py", line 259, in <module>
    with VideoTracker(args) as vdo_trk:
  File "main.py", line 53, in __init__
    cfg.merge_from_file(args.config_deepsort)
  File "/home/dji/Desktop/targetTrackers/howieMa/DeepSORT_YOLOv5_Pytorch/utils_ds/parser.py", line 23, in merge_from_file
    self.update(yaml.load(fo.read()))
TypeError: load() missing 1 required positional argument: 'Loader'

按照对应解决方案,将/home/dji/Desktop/targetTrackers/howieMa/DeepSORT_YOLOv5_Pytorch/utils_ds/parser.py中所有的yaml.load替换为yaml.safe_load,待修改的原代码如下:

class YamlParser(edict):
    """
    This is yaml parser based on EasyDict.
    """
    def __init__(self, cfg_dict=None, config_file=None):
        if cfg_dict is None:
            cfg_dict = {}

        if config_file is not None:
            assert(os.path.isfile(config_file))
            with open(config_file, 'r') as fo:
                cfg_dict.update(yaml.load(fo.read()))

        super(YamlParser, self).__init__(cfg_dict)

    
    def merge_from_file(self, config_file):
        with open(config_file, 'r') as fo:
            self.update(yaml.load(fo.read()))

    
    def merge_from_dict(self, config_dict):
        self.update(config_dict)

二次报错:非法指令核心转储

完成上述修改后重新运行同一条命令,出现新的报错:

$ python main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU

Using webcam 0
Done..
Camera ...
Done. Create output file  output/results.mp4
Illegal instruction (core dumped)

请问是否有人遇到过类似问题?感谢解答。

内容的提问来源于stack exchange,提问作者fatbringer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.28 01:45:02