Comments (35)
I encountered the same problem, but when I set the parameter “save_hybrid” to False, this issue is resolved.
from ultralytics.
i use 460 , i should use 480, thank you
that happened because in yolov5 it was correct automatically , sorry .
from ultralytics.
Pls send the code that you use to train
And also what do you want to do
I mean you working on instance segment or what
from ultralytics.
@aleehamza25 i'm glad to hear that setting the parameter "save_hybrid" to False resolved the issue for you! Sometimes small changes can have a big impact. If you have any more questions or need further assistance, feel free to ask!
from ultralytics.
when change the img size to 640 the code run correctly ? why?
from ultralytics.
@totoadel you have to make sure the img size can be divided by 32. That's the rule. :)
from ultralytics.
@totoadel you have to make sure the img size can be divided by 32. That's the rule. :)
It works with YOLOv5, it will automatically change the image size to be divisible by 32. I guess v8 doesnt do that?
from ultralytics.
@Laughing-q my image sizes are 1024x1024 but not working. i am facing this error
Sizes of tensors must match except in dimension 1. Expected size 57 but got size 0 for tensor number 1 in the list.
Sentry is attempting to send 1 pending error messages
i am using this command to run yolo instance segmentation
!yolo task=segment mode=train model=yolov8m-seg.pt data={dataset.location}/data.yaml epochs=100 imgsz=1024 batch=8
when i change image sizes or batch size the expected size in error changes to another number
from ultralytics.
@Caliphamin Training with your command but with coco128-seg.yaml works correctly to me.
yolo task=segment mode=train model=yolov8m-seg.pt data=coco128-seg.yaml epochs=100 imgsz=1024 batch=4
BTW I'm using the latest version of package.
from ultralytics.
@Laughing-q
I’ve changed my data format to yolov8
from ultralytics.
@Laughing-q
Can i send my data for you?
I’ve uploaded on roboflow
from ultralytics.
@Caliphamin sure, [email protected].
from ultralytics.
@Caliphamin I just checked your dataset, and found you were using a detection labels but trying to train a segmentation model which is incorrect. You should always train a segmentation model with segmentation labels.
BTW I just saw the following error when I was trying to reproduce your issue but it seems that you didn't encounter this error msg.
So I suppose that you might also need to upgrade the package pip install --upgrade ultralytics
.
from ultralytics.
@Laughing-q ooooh, you mean my data is wrong. actually i did not get this message. i just thought my image sizes or batch sizes are wrong
thanks for helping me.
i am going to change my data and try it again.
from ultralytics.
@Caliphamin Also It's better to use the latest version of package. :)
from ultralytics.
I will do that too:)
from ultralytics.
@Laughing-q I am getting the same erroe can you check my dataset too..
Here is the link to the dataset: https://app.roboflow.com/btech-project/heavy-vehicle-detection-and-classification
from ultralytics.
@AnonymousPhython my problem solved by changing dataset label from object detection to instance segmentation
What is your dataset format?(i mean yolo, coco and etc)
from ultralytics.
@AnonymousPhython my problem solved by changing dataset label from object detection to instance segmentation What is your dataset format?(i mean yolo, coco and etc)
hi, it is YOLOv8 i am using yolov8n-seg.
you can take a look into my dataset at https://app.roboflow.com/btech-project/heavy-vehicle-detection-and-classification
from ultralytics.
thanks.. it is working now..
from ultralytics.
@AnonymousPhython What?how?😁
from ultralytics.
I apologize for any confusion. I am an AI language model and sometimes my responses might not make sense or be relevant to the conversation. Is there anything I can assist you with?
from ultralytics.
I got the same error, size of a tensor is not matched, even when I m using 416 and 640 image sizes.
Please help
from ultralytics.
@Kr-Sheshank it seems you are ruining training on local pc , if true, change batch=1
from ultralytics.
No i m running in google colab,
@Kr-Sheshank it seems you are ruining training on local pc , if true, change batch=1
from ultralytics.
@Caliphamin Training with your command but with coco128-seg.yaml works correctly to me.
yolo task=segment mode=train model=yolov8m-seg.pt data=coco128-seg.yaml epochs=100 imgsz=1024 batch=4BTW I'm using the latest version of package.
I tried this it is working, training for coco data set is working but not for my dataset which I'm using from exporting from roboflow
from ultralytics.
@Kr-Sheshank write down your .yaml file here
from ultralytics.
@Kr-Sheshank write down your .yaml file here
names:
- Crack
nc: 1
roboflow:
license: CC BY 4.0
project: crack-segmentation-otg56
url: https://universe.roboflow.com/iiti/crack-segmentation-otg56/dataset/4
version: 4
workspace: iiti
test: ../test/images
train: Crack-Segmentation-4/train/images
val: Crack-Segmentation-4/valid/images
from ultralytics.
I think problem is with my dataset,I used another v8 segment data set from roboflow than training got start
from ultralytics.
@VYRION-Ai based on the error message you posted, it looks like the issue may be with your dataset. If you used another YOLOv8 segment dataset from Roboflow and the training started successfully, then it could be that your original dataset may have had issues with it. You may want to double check your original dataset to ensure that it's properly formatted and contains the necessary files and annotations in the correct format for YOLOv8 to work with.
from ultralytics.
@AnonymousPhython What?how?😁
@AnonymousPhython my problem solved by changing dataset label from object detection to instance segmentation What is your dataset format?(i mean yolo, coco and etc)
I encounter same problem.I guess something wrong in the process during json file convert to txt file.But I am not sure.Can you help me .
from ultralytics.
I got the same above problems in Yolov8
My command is yolo detect train data=kitti.yaml model=yolov8s_test.yaml epochs=50 imgsz=640
this is my yaml file
`
backbone:
[from, repeats, module, args]
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
- [-1, 3, C2f, [128, True]] # 2
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
- [-1, 6, C2f, [256, True]] # 4
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
- [-1, 6, C2f, [512, True]] # 6
- [-1, 1, Conv, [768, 3, 2]] # 7-P5/32
- [-1, 6, C2f, [768, True]] # 8
- [-1, 1, Conv, [1024, 3, 2]] # 9-P6/64
- [-1, 3, C2f, [1024, True]] # 10
- [-1, 1, SPPF, [1024, 5]] # 11
head:
-
[-1, 1, nn.Upsample, [None, 2, 'nearest']] # 12
-
[[-1, 8], 1, Concat, [1]] # cat backbone P5 # 13
-
[-1, 3, C2f, [768]] # 14
-
[-1, 1, nn.Upsample, [None, 2, 'nearest']] # 15
-
[[-1, 6], 1, Concat, [1]] # cat backbone P4 # 16
-
[-1, 3, C2f, [512]] # (P4/16-medium) # 17
-
[-1, 1, Conv, [512, 3, 2]] # 18
-
[[-1, 14], 1, Concat, [1]] # cat head P3 # 19
-
[-1, 3, C2f, [768]] # (P5/32-large) # 20
-
[[17, 20], 1, Detect, [nc]] # Detect(P4, P5, P6) # 24
`
Actually, I want to use only medium and large heads that's why I did to scale up in backbone but it couldn't
Why is this not working? Anybody can help me?
Image sizes 640 train, 640 val Using 8 dataloader workers Logging results to runs\detect\train11 Starting training for 50 epochs... Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 1/50 3.25G 4.309 3.989 3.242 11 640: 100%|██████████| 335/335 [00:58<00:00 Class Images Instances Box(P R mAP50 mAP50-95): 0%| | 0/43 [00: Traceback (most recent call last): File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\dlwlsgh\.conda\envs\yolov8\Scripts\yolo.exe\__main__.py", line 7, in <module> File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\cfg\__init__.py", line 317, in entrypoint getattr(model, mode)(**overrides) # default args from model File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\engine\model.py", line 325, in train self.trainer.train() File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\engine\trainer.py", line 186, in train self._do_train(RANK, world_size) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\engine\trainer.py", line 357, in _do_train self.metrics, self.fitness = self.validate() File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\engine\trainer.py", line 453, in validate metrics = self.validator(self) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\torch\autograd\grad_mode.py", line 26, in decorate_context return func(*args, **kwargs) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\yolo\engine\validator.py", line 159, in __call__ preds = model(batch['img']) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\nn\tasks.py", line 199, in forward return self._forward_once(x, profile, visualize) # single-scale inference, train File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\nn\tasks.py", line 58, in _forward_once x = m(x) # run File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "C:\Users\dlwlsgh\.conda\envs\yolov8\lib\site-packages\ultralytics\nn\modules.py", line 352, in forward return torch.cat(x, self.d) RuntimeError: Sizes of tensors must match except in dimension 2. Got 7 and 8 (The offending index is 0)
I already try to change stride 32 to 64 in "v5loader.py", "build.py" and "trainer.py"
Plz help me
from ultralytics.
I encountered the same problem, but when I set the parameter “save_hybrid” to False, this issue is resolved.
I was exhausted after wasting my whole day due to this parameter. You just saved my life
from ultralytics.
!yolo task=segment mode=train model=yolov8s-seg.pt data=dataset.yaml epochs=10 imgsz=320 batch= 4 save=true
This problem arise when i am training custom data on yolov8 segmentation model
from ultralytics.
@MandilJThapa it looks like there might be an issue with the way the dataset or the model is configured. Could you please check if your dataset.yaml
is correctly set up for segmentation tasks, and that the paths to images and labels are correct? Also, ensure that your model yolov8s-seg.pt
is compatible with the segmentation task you're aiming at. If the problem persists, it could be helpful to share the dataset.yaml
content and any error logs for more context.🙂
from ultralytics.
Related Issues (20)
- Exporting ONNX OBB models But the dimensions of the output results are inconsistent HOT 3
- Multi-scale of yolov8-obb HOT 5
- Segment How to achieve the effect of OBB HOT 2
- Not able to import yolo HOT 3
- How to get the estimated time it takes to train a yolov8 model HOT 2
- training:high CPU usage,the first epoch dies HOT 6
- yolo_world HOT 2
- I'm using YOLOV8 to detect a character by training custom model. The detected item is not able to retrieve its class name, a box appears instead. How do I make fix? HOT 10
- What is the native underlaying/implementation framework of Yolov8? HOT 2
- export to tensorrt with version 10.0.6 HOT 2
- OBB model on triton server cause NMS error (probably not evaulated with task='obb' but task='detect') HOT 5
- predict save location HOT 4
- Yolov8-pose is not returning the "id" when the triton is used HOT 2
- How to print the results of people ID, coordinates of the box in each second as csv HOT 3
- Tflite output shape is not matching with onnx / coreml HOT 2
- Multi node training of YOLOv8 Stuck in the following steps HOT 1
- Unable to test without training HOT 2
- Tensorflow JS | Real-time Object Detection with YOLO and Webcam HOT 2
- In DDP, pretrained model won't be loaded. HOT 2
- 使用yolov8 :print(results.pandas().xyxy[0]) AttributeError: 'list' object has no attribute 'pandas' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.