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

使用YOLOv5通过RTSP流检测时遇OSError: [WinError 123]的解决咨询

解决YOLOv5检测命令的WinError 123错误

针对执行python detect.py --source rtsp://admin:xxxxx@10.xx.xx.xxx//streaming/channels/1 --weights runs/train/exp4/weights/best.pt时出现的OSError: [WinError 123] 文件名、目录名或卷标语法不正确错误,可按以下步骤解决:

  • 修正RTSP地址的斜杠:地址里的//streaming是问题点之一,Windows环境下双斜杠会被误解析为路径分隔符,改为单斜杠即可,修正后地址为rtsp://admin:xxxxx@10.xx.xx.xxx/streaming/channels/1。

  • 给RTSP地址添加引号:Windows命令行对含特殊字符(如@)的字符串解析易出错,把整个RTSP地址用双引号包裹,避免参数被错误拆分。修改后的完整命令:

    python detect.py --source "rtsp://admin:xxxxx@10.xx.xx.xxx/streaming/channels/1" --weights runs/train/exp4/weights/best.pt
    
  • 检查权重文件路径:确认runs/train/exp4/weights/best.pt路径在Windows下有效,若路径含空格或特殊字符,同样需要用双引号包裹。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.16 04:25:36