yolov5 奇奇怪怪的错误汇总:【版本兼容,模型训练,数据加载,模型加速】

文章大纲


最近用完yolov5给我的体验就是:

  1. 代码各个小版本都不相互兼容
  2. 上github 给提issue ,作者反应倒是很快,但是基本都是机器人回复
  3. 非常非常多的训练技巧,一不注意就掉坑里

不同小版本的网络不兼容问题

RuntimeError: The expanded size of the tensor (1) must match…

 self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)
RuntimeError: The expanded size of the tensor <
引用\[1\]:\[hevc @ 000001716438fc00\] Two slices reporting being the first in the same frame. \[hevc @ 000001716439ec80\] Could not find ref with POC 2 。 引用\[2\]:解决办法:使用avio_alloc_context的回调函数read_packet来给ffmpeg喂数据。 经过测试,不会出现Could not find ref with POCXX的问题。 经测试,延时160ms AVIOContext *avio_alloc_context( unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence)); 。 引用\[3\]:中可以设置CPU数量,那么应该怎么做呢 设置调用的CPU线程数量 // 注册解码器 avcodec_register_all(); AVCodec *vc = avcodec_find_decoder(ic->streams\[videoStream\]->codecpar->codec_id); // 软解 // vc = avcodec_find_decoder_by_name("h264_mediacodec"); // 硬解 if (!vc) { LOGE("avcodec_find_decoder\[videoStream\] failure"); return env->NewStringUTF(hello.c_str()); } // 配置解码器 AVCodecContext *vct = avcodec_alloc_context3(vc); avcodec_parameters_to_context(vct, ic->streams\[videoStream\]->codecpar); vct->thread_count = 1;//设置CPU线程数量 // 打开解码器 int re = avcodec_open2(vct, vc, 0); if (re != 0) { LOGE("avcodec_open2 failure"); return env->NewStringUTF(hello.c_str()); } 2.将网络接收的缓冲设大 。 问题:Could not find ref with POC 回答: "Could not find ref with POC"是ffmpeg中的一个错误消息,它表示在解码过程中找不到参考帧。这个问题可能是由于多个切片在同一帧中报告为第一个切片引起的\[1\]。解决这个问题的方法是使用avio_alloc_context的回调函数read_packet来提供数据给ffmpeg,并且经过测试,这样就不会出现"Could not find ref with POC"的问题\[2\]。另外,还可以通过设置CPU线程数量来优化解码过程,可以将vct->thread_count设置为所需的线程数量\[3\]。此外,还可以尝试将网络接收的缓冲区大小增加来解决问题\[3\]。 #### 引用[.reference_title] - *1* *2* [Two slices reporting being the first in the same frame. 和 Could not find ref with POCXX问题](https://blog.csdn.net/asdasfdgdhh/article/details/121826433)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ffmpeg解析实时h265/264视频流,出现Could not find ref with POCXX问题解决方法](https://blog.csdn.net/u013241583/article/details/104796741)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shiter

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值