-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
How to configure channel size #1739
Comments
@thhart you can create a YOLOv5 model with non-default channel size with PyTorch Hub. See PyTorch Hub tutorial: The training dataloader defaults to 3 ch images, you'd have to manually modify it to your needs: Line 336 in ab0db8d
|
@thhart by the way, Lines 69 to 87 in ab0db8d
|
@thhart I would perhaps update yolo.py L84 to this to allow you to use a self.model, self.save = parse_model(deepcopy(self.yaml), ch=[self.yaml.get('ch', ch)]) # model, savelist |
@thhart PR #1741 is merged now, adding support for optional input channel definition in model yaml files, i.e. # parameters
nc: 80 # number of classes
ch: 10 # input channels <------------------------
depth_multiple: 0.33 # model depth multiple
width_multiple: 0.50 # layer channel multiple Tested with 1, 3 and 10 channel models. |
Hello, I used the YOLOv5 model to train a single-channel image, but it was unsuccessful. How can I modify the data loader part in the datasets.py file to train a single-channel image? Sincerely hope you can answer, thank you. |
@wangfurong123 dataloaders are in datasets.py: Lines 377 to 378 in 7a39803
|
I have successfully obtained a six-channel input pt model. How can I convert it to an onnx model? What modifications need to be made to export.py?I ran export.py directly and reported the following error: |
Hi @xiaoche-24! To convert a six-channel input PyTorch model to an ONNX model, you need to make some modifications in the You received the error because the weights of one of the layers in your model have a fixed size of [32, 3, 6, 6]. This implies that it expects an input with 3 channels, but your input has 6 channels. To resolve this issue, you need to modify the Make sure to change the default value of Let me know if you have any further questions or need additional assistance! |
Hi bro, can I tweet you to ask some questions? |
sry,I don't have Twitter.You can ask the question directly here. |
do you have wechat xiongdi |
@wq247726404 i'm here to help with any questions you may have regarding YOLOv5! Feel free to ask here and I'll do my best to assist you. |
I checked the training tutorial but could not find a central configuration setting to specify the input channel size for training. Is this possible within yaml files or is it necessary to change something in yolo.py for instance?
I tried to put ch into yaml but it looks like not being parsed.
The text was updated successfully, but these errors were encountered: