Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sizes of tensors must match except in dimension 1. Expected size 57 but got size 0 for tensor number 1 in the list #84

Closed
1 of 2 tasks
Caliphamin opened this issue Mar 21, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Caliphamin
Copy link

Search before asking

  • I have searched the Roboflow Notebooks issues and found no similar bug report.

Notebook name

train-yolov8-instance-segmentation-on-custom-dataset

Bug

hello
i want to instance segmentation with yolov8 but i've got this error and i am stuck here
i use this command to run yolov8
!yolo task=segment mode=train model=yolov8m-seg.pt data={dataset.location}/data.yaml epochs=100 imgsz=1024 batch=8
my images width and height are 1024x1024
i get 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

also when i change image sizes or batch size the number of expected size changed in error

Environment

google colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@Caliphamin Caliphamin added the bug Something isn't working label Mar 21, 2023
@github-actions
Copy link

👋 Hello @Caliphamin, thank you for leaving an issue on Roboflow Notebooks.

🐞 Bug reports

If you are filing a bug report, please be as detailed as possible. This will help us more easily diagnose and resolve the problem you are facing. To learn more about contributing, check out our Contributing Guidelines.

If you require support with custom code that is not part of Roboflow Notebooks, please reach out on the Roboflow Forum or on the GitHub Discussions page associated with this repository.

💬 Get in touch

Do you have more questions about Roboflow that we haven't responded to yet? Feel free to ask them on the Roboflow Discuss forum. Our developer advocates and community team actively respond to questions there.

To ask questions about Notebooks, head over to the GitHub Discussions section of this repository.

@SkalskiP
Copy link
Collaborator

Hi, @Caliphamin 👋🏻! Could you share a link to the dataset you used?

@SkalskiP SkalskiP self-assigned this Mar 21, 2023
@Caliphamin
Copy link
Author

Caliphamin commented Mar 21, 2023

@SkalskiP SkalskiP mentioned this issue Mar 22, 2023
2 tasks
@SkalskiP
Copy link
Collaborator

Hi, @Caliphamin 👋🏻! I examined the issue. And I think I know the reason.

Roboflow allows you to use bounding boxes in segmentation projects. However YOLOv8 project does not allow for such flexibility. Because your image segmentation dataset contains boxes, it fails to load correctly. But... I tried to use your dataset for object detection training with this command:

!yolo task=segment mode=train model=yolov8s.pt data={dataset.location}/data.yaml epochs=3 imgsz=640

And it works. 🎉 I know it is not e perfect solution, but given the current situation, I think it is best we can do it quickly.

@SkalskiP
Copy link
Collaborator

SkalskiP commented Apr 3, 2023

I'm closing that issue. Feel free to reopen it if needed.

@SkalskiP SkalskiP closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants