You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the YOLOv5 issues and discussions and found no similar questions.
Question
I did not make any mistakes in the training before October 27, and I made an error in the training on October 29. When I retrained the previous model, I still reported an error even though none of the parameters had changed:
0%| | 0/353 [00:02<?, ?it/s]
Traceback (most recent call last):
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 908, in
main(opt)
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 682, in main
train(opt.hyp, opt, device, callbacks)
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 385, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "D:\code\YOLOV5-master\utils\loss.py", line 154, in call
pxy, pwh, _, pcls = pi[b, a, gj, gi].split((2, 2, 1, self.nc), 1) # target-subset of predictions
File "D:\software\anaconda\envs\pytorch-2.1\lib\site-packages\torch_tensor.py", line 864, in split
return torch._VF.split_with_sizes(self, split_size, dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
My nc is 126 and pi is shown as torch.Size([45, 393, 80, 80])
Additional
In the training from October 29 to today, the step of downloading yolov 5n.pt suddenly appeared, which was not available before
The text was updated successfully, but these errors were encountered:
👋 Hello @lllittleX, thank you for your interest in YOLOv5 🚀! It sounds like you're encountering an issue that might be a 🐛 bug. To help us investigate, please provide a minimum reproducible example that includes any relevant code snippets or configurations that lead to the error.
If this involves custom training, please ensure you include details about your dataset, any custom modifications, and the complete error traceback. This information will be crucial to diagnosing the problem.
For your setup, make sure you are using Python>=3.8.0 with all requirements installed, including PyTorch>=1.8. It's important to use a clean environment to rule out any dependency issues.
YOLOv5 can be run in diverse environments, including Jupyter notebooks, Google Cloud, AWS, and Docker. Make sure your environment is up to date with all dependencies, such as CUDA/CUDNN, Python, and PyTorch, preinstalled.
Meanwhile, an Ultralytics engineer will review your issue soon to provide further assistance. Thanks for your patience! 😊
By the way, have you checked out YOLOv8? It's our latest model, offering state-of-the-art performance for 2023 in object detection, image segmentation, and classification tasks!
@lllittleX it seems like there might be a mismatch between your model's output dimensions and the expected dimensions for your classes. Please ensure that your nc (number of classes) is correctly set to 126 in your configuration files and matches the model's architecture. Additionally, verify that you are using the latest version of YOLOv5 to rule out any recent changes that might affect your setup. If the issue persists, consider checking your dataset and label files for any inconsistencies.
Search before asking
Question
I did not make any mistakes in the training before October 27, and I made an error in the training on October 29. When I retrained the previous model, I still reported an error even though none of the parameters had changed:
0%| | 0/353 [00:02<?, ?it/s]
Traceback (most recent call last):
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 908, in
main(opt)
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 682, in main
train(opt.hyp, opt, device, callbacks)
File "D:/code/YOLOV5-master/train_FoodDetection.py", line 385, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "D:\code\YOLOV5-master\utils\loss.py", line 154, in call
pxy, pwh, _, pcls = pi[b, a, gj, gi].split((2, 2, 1, self.nc), 1) # target-subset of predictions
File "D:\software\anaconda\envs\pytorch-2.1\lib\site-packages\torch_tensor.py", line 864, in split
return torch._VF.split_with_sizes(self, split_size, dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
My nc is 126 and pi is shown as torch.Size([45, 393, 80, 80])
Additional
In the training from October 29 to today, the step of downloading yolov 5n.pt suddenly appeared, which was not available before
The text was updated successfully, but these errors were encountered: