yolov5 7.0运行segment/predict.py时出现TypeError: meshgrid() got an unexpected keyword argument ‘indexing‘

问题描述

第一次运行segment/predict.py时会出现错误:

TypeError: meshgrid() got an unexpected keyword argument ‘indexing‘

解决方法:

在yolo.py中源代码:

yv, xv = torch.meshgrid([torch.arange(hsize), torch.arange(wsize)], indexing="ij")

删除indexing="ij"即可

yv, xv = torch.meshgrid([torch.arange(hsize), torch.arange(wsize)])

你可能感兴趣的:(计算机视觉)