-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Can not import YOLO from ultralytics #2802
Comments
after you done |
no, i just pip install ultralytics, and use "from ultralytics import YOLO" |
@Kayzwer thank you for your response. To clarify, if you are cloning the YOLOv8 source and doing a |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
@glenn-jocher I have cloned ultralithic for YOLOv8. How to modify the YOLOv8 architecture, for example by substituting new blocks that I designed myself or from the latest journal papers. Currently I am a Ph.D student doing research to identify microorganisms. I hope you can help me. Thank You |
@ovidedecroly hello, Thank you for reaching out. It's really exciting to hear about your work in identifying microorganisms using YOLOv8. To modify the YOLOv8 architecture with your own, custom-designed blocks, you need to go to the model's configuration file. Usually, this is a .yaml file in the To insert your blocks into this model, you need to define your blocks following the syntax presented in this .yaml file. Once you've defined your blocks, you can replace or add these new blocks into the desired position in the model's configuration. Remember, your custom blocks might change the shapes of the input or output, so be cautious about maintaining compatibility across your changes. You also need to account for the parameters that are fed through each layer and ensure continuity. Once you've updated the .yaml file, you can use it to train YOLOv8 using your adjusted model architecture. Keep in mind that if you make substantial changes in the model's architecture, you may need to tune hyper-parameters and adjust training configurations accordingly to optimize the model's performance. We look forward to seeing how your works contribute to the YOLO community and the scientific community at large. Best of luck on your research! Best wishes, |
@glenn-jocher Hello, |
@ovidedecroly hello, Thank you for contacting us. It appears that there might be an issue with your installation or importing statement. In the YOLOv8 repository, importing the YOLO class directly from 'ultralytics' is not how it's designed to operate. The YOLO class should be imported from the 'models' module in the Ultralytics YOLOv8 repo. When you successfully install the Ultralytics YOLOv8 repository and all its dependencies, you should be able to import the YOLO class by first navigating to the correct directory where the 'models' module resides. Then you can execute 'from models import YOLO' to import the YOLO class. Lastly, the 'YOLO' function takes the file path of the configuration file, which in your case is 'yolov8.yaml'. Please make sure 'yolov8.yaml' is in your current working directory or provide the absolute path of the 'yolov8.yaml' configuration file to the 'YOLO' function. I hope this helps, and please let us know if you have additional issues. |
@glenn-jocher hello 8 frames RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 512 but got size 256 for tensor number 1 in the list. For the YAML that I changed. Ultralytics YOLO 🚀, AGPL-3.0 licenseYOLOv8 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detectParametersnc: 20 # number of classes [depth, width, max_channels]n: [0.33, 0.25, 1024] # YOLOv8n summary: 225 layers, 3157200 parameters, 3157184 gradients, 8.9 GFLOPs #YOLOv8.0n backbone [from, repeats, module, args]
#YOLOv8.0n head
Thanks |
@ovidedecroly hello, It appears you're encountering an error when integrating LightConv layers into your YOLOv8 model. The error message is suggesting that there is a mismatch in tensor sizes, possibly due to the changes you made with replacing Conv with LightConv. LightConv layers might be outputting different tensor sizes than the standard Conv layers which were originally used in the model. The subsequent layers or operations (like concatenation) expect a certain input size, if it does not match they throw this kind of error. To fix this, you'll need to understand and align the expected tensor size between each of your layers by either adjusting the way the inputs or outputs are handled with your new LightConv layers, or accommodating the new sizes in the subsequent layers in your model. It requires a good understanding of how each of these custom layers modifies the input tensor. Also, keep in mind that when we modify the architecture YAML file, we must ensure that the changes are propagated effectively in the corresponding model files. Best of luck with your research, it sounds like an interesting adaption of the YOLOv8 model! |
Search before asking
YOLOv8 Component
No response
Bug
When i upgrade the newest ultralytics, it raise error so i can not use YOLOv5 or YOLOv8 :((( sorry for my poor english
Environment
No response
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: