liux0614 / yolo_nano

Unofficial implementation of yolo nano
MIT License
254 stars 72 forks source link

训练阶段出现维度不匹配,还望博主给些指导 #25

Open emlfaa opened 4 years ago

emlfaa commented 4 years ago
Traceback (most recent call last):
  File "main.py", line 105, in <module>
    train(model, optimizer, train_dataloader, epoch, opt, train_logger, visualizer)
  File "/media/yolo_nano-master/train.py", line 27, in train
    loss, detections = model.forward(images, targets)
  File "/media/yolo_nano-master/models/yolo_nano.py", line 134, in forward
    temp, layer_loss = self.yolo_layer52(out_conv9, targets, image_size)
  File "/home/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/media//yolo_nano-master/models/basic_layers.py", line 197, in forward
    ignore_thres=self.ignore_thres,
  File "/media/yolo_nano-master/utils/stats.py", line 303, in build_targets
    obj_mask[b, best_n, gj, gi] = 1
IndexError: index 44 is out of bounds for dimension 3 with size 44

你好博主,我在利用你的模型训练的时候中间出现这个错误,我检测的类别是3类,我查看了一下,但是没有看出哪里又错误,还望博主有时间的情况下,给些指导,感谢!

xielangxiong commented 4 years ago

请问楼主,你把问题解决了马?我也遇到同样的问题