File "E:/learning/NEW/code/yolov8/NWPU/yolov8-pytorch-master/train.py", line 548, in <module> fit_one_epoch(model_train, model, ema, yolo_loss, loss_history, eval_callback, optimizer, epoch, epoch_step, epoch_step_val, gen, gen_val, UnFreeze_Epoch, Cuda, fp16, scaler, save_period, save_dir, local_rank) File "E:\learning\NEW\code\yolov8\NWPU\yolov8-pytorch-master\utils\utils_fit.py", line 34, in fit_one_epoch outputs = model_train(images) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\parallel\data_parallel.py", line 166, in forward return self.module(*inputs[0], **kwargs[0]) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "E:\learning\NEW\code\yolov8\NWPU\yolov8-pytorch-master\nets\yolo.py", line 165, in forward self.anchors, self.strides = (x.transpose(0, 1) for x in make_anchors(x, self.stride, 0.5)) File "E:\learning\NEW\code\yolov8\NWPU\yolov8-pytorch-master\utils\utils_bbox.py", line 25, in make_anchors sy,sx = torch.meshgrid(sy, sx, indexing='ij') if TORCH_1_10 else torch.meshgrid(sy, sx) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\functional.py", line 463, in meshgrid return _meshgrid(*tensors, indexing=indexing) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\functional.py", line 478, in _meshgrid return _VF.meshgrid(tensors, **kwargs,indexing='ij') # type: ignore[attr-defined] TypeError: meshgrid() got multiple values for keyword argument 'indexing'
时间: 2023-06-30 18:08:03 浏览: 212
目标检测-基于Yolov8在NWPU-VHR-10+DOTA数据集上实现小目标检测算法-附项目源码-优质项目实战.zip
这个错误是由于你使用了 PyTorch 的多 GPU 训练,但是在使用 meshgrid 函数时,指定了 indexing 参数两次,导致报错。你可以检查一下代码中使用 meshgrid 函数的地方,确保只指定了一次 indexing 参数。如果还有问题,可以提供更多的代码和错误信息,便于更好地定位问题。
阅读全文