Open Kelly02140 opened 1 month ago
@Kelly02140 hello,
Thank you for reaching out and providing detailed information about your issue.
The error AttributeError: 'DetectMultiBackend' object has no attribute 'input_details'
typically occurs when there is a mismatch between the code and the model weights being used. Here are a few steps to help troubleshoot and resolve this issue:
Update YOLOv5 Repository: Ensure you are using the latest version of the YOLOv5 repository. You can update your local repository by running:
git pull
Verify Model Compatibility: Make sure that the custom-trained weights are compatible with the version of YOLOv5 you are using. Sometimes, weights trained on older versions may not be compatible with newer code.
Check for Model Conversion: If you have converted your model to another format (e.g., TensorFlow, ONNX), ensure that the conversion process was successful and that the model is correctly loaded.
Re-train or Re-export Weights: If the issue persists, consider re-training your model or re-exporting the weights using the latest YOLOv5 codebase.
Example Code: Here is a snippet to ensure you are loading the model correctly:
from yolov5 import YOLOv5
# Load model
model = YOLOv5('path/to/your/custom/weights.pt')
# Perform inference
results = model('path/to/your/video.mp4')
Environment Check: Ensure that your environment has all the required dependencies updated. You can do this by running:
pip install -r requirements.txt
If you have verified all the above steps and the issue still persists, please provide additional details such as the exact steps you followed to train and export your custom weights. This will help in diagnosing the problem more effectively.
Feel free to reach out if you have any further questions or need additional assistance. The YOLO community and the Ultralytics team are here to help! 😊
Search before asking
Question
Hello, I am doing a YOLOv5 project with DeepSort added to give each detected object a unique ID. I use yolov5n.pt as the weight to test a short video and It all works well. However, when I try to put my own trained weight profile to test the video, it gives me this error: 'AttributeError: 'DetectMultiBackend' object has no attribute 'input_details' Could anyone help me with this problem?
![image](https://github.com/user-attachments/assets/103612bd-9514-4356-a293-f9fa00c7feb4)
Additional
No response