-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
conv2d() received an invalid combination of arguments #13453
Comments
👋 Hello @niusme, thank you for your interest in YOLOv5 🚀! It looks like you're encountering an issue during inference with a trained model. This may be related to how the input is being passed to the model. For better assistance, could you please provide a minimum reproducible example including the following details?
If this is related to custom training, ensure that your workflow aligns with best practices for data preparation, training, and inference, including correctly preparing the inputs for the model. Here are some tips to troubleshoot while we investigate further:
This is an automated response to assist you efficiently. An Ultralytics engineer will review your issue and provide further assistance soon 😊. Thank you for your patience! |
@niusme the issue arises because the Here’s how you can resolve it: Replace the from PIL import Image
import torchvision.transforms as transforms
# Load image and preprocess
image_path = r'D:\py\code\dnfm-yolo-tutorial\naima\28.png'
image = Image.open(image_path).convert('RGB')
transform = transforms.ToTensor()
image_tensor = transform(image).unsqueeze(0) # Add batch dimension
# Pass tensor to the model for inference
results = model(image_tensor) If the problem persists, ensure your |
the image needs to be transformed to 640x640 first right? so replace this |
Search before asking
Question
environment
windows10
python3.8
question
I used the trained model to detect. The following code throws an error
the error
Additional
No response
The text was updated successfully, but these errors were encountered: