搭建Yolov5_DeepSort时遇到的问题:问题1:UserWarning: torch.meshgrid: in an upcoming release;问题2:[mov,mp4,m4a,3gp

问题1:UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument.

 解决方法:

根据报错的提示点击上述报错提示的蓝色字体,然后跳转到相应的functional.py文件中

根据查找ctr+F快捷键输入:

_VF.meshgrid 

找到对应的位置,然后出现找到下面图片所展示的位置:

  

 加上如下代码 indexing = 'ij'

 torch.meshgrid 的使用

torch.meshgrid(*tensors, indexing=None)

indexing 是 torch.meshgrid 的一个参数。

torch.meshgrid 的功能是生成 “网格数据”,比如生成一张图像的所有像素坐标。

indexing='ij'
返回的:
grid_i shape: torch.Size([7, 4])
grid_j shape: torch.Size([7, 4])

他们的shape都是 [W,H]
shape 第 0 维是 W,第 1 维是 H
输入 torch.meshgrid 参数 W_arange, H_arange的相对顺序是一致的

indexing=‘xy’

返回的:
grid_x shape: torch.Size([4, 7])
grid_y shape: torch.Size([4, 7])

他们的shape都是 [H,W]

shape 第 1 维是 W,第 0 维是 H
输入 torch.meshgrid 参数 W_arange, H_arange的相对顺序是相反的。

问题2:[mov,mp4,m4a,3gp,3g2,mj2 @ 000001fe939c8d80] moov atom not found

 视频文件出现了问题,可去检查自己的视频文件是否还可以打开,如果可以打开并且格式是.mp4就没有问题,如果没法通过播放器打开,就可以重新录入视频文件。

问题3:在运行Yolov5_DeepSort目标追踪无法保存视频

可以从下面的图片看到我已经运行成功了,并且已经检测完成了。

 在设置track.py的参数的时候,将结果文件放在output文件夹下的:

 可是最后我的output文件中没有输出文件

 

 解决方法:

找到track.py文件,找到track.py文件下对应的detect函数,在其中的对应位置输入:

save_vide=True

猜你喜欢

转载自blog.csdn.net/m0_74890428/article/details/131042830