Comments (2)
@yjseok hello,
Thank you for reaching out and for your thorough search before posting your question! Currently, val.py
in YOLOv5 does not support multi-GPU validation directly through the --device
parameter. The multi-GPU functionality is primarily designed for training purposes using train.py
.
However, you can achieve multi-GPU validation by modifying the code to use torch.nn.DataParallel
or torch.nn.parallel.DistributedDataParallel
. Hereโs a brief guide on how you might approach this:
-
Clone the YOLOv5 repository and install dependencies:
git clone https://github.com/ultralytics/yolov5 cd yolov5 pip install -r requirements.txt
-
Modify
val.py
to usetorch.nn.DataParallel
:import torch from models.yolo import Model # Load model model = Model(cfg='yolov5s.yaml', ch=3, nc=80).to(device) # Wrap model with DataParallel if torch.cuda.device_count() > 1: model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3]) # Validate results, maps, times = validate(model=model, ...)
-
Run the modified
val.py
:python val.py --data coco.yaml --weights yolov5s.pt --device 0,1,2,3
For more detailed instructions and advanced configurations, you can refer to our Multi-GPU Training Guide.
If you encounter any issues or have further questions, please provide a minimum reproducible example of your code and the specific error messages you are seeing. This will help us to better understand and address your issue. You can find more information on creating a minimum reproducible example here.
Lastly, please ensure you are using the latest versions of torch
and the YOLOv5 repository to avoid any compatibility issues.
from yolov5.
๐ 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:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
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 โญ
from yolov5.
Related Issues (20)
- What prevents me from using the AMP function๏ผ HOT 1
- Background annotation HOT 6
- Hi @7rkMnpl, HOT 2
- Multiple GPU Hyperparameter evolution HOT 5
- Marking YOLOv5 Detection Text Outputs with TP or FP HOT 4
- Multiple threads using yolov5 model concurrent inference failed HOT 4
- Detect head structure differs HOT 4
- runs\train\exp10 is not a directory HOT 12
- Similar mAP when splitting data into train, val and test HOT 4
- Syntax and understanding questions about reading tensorflow lite results HOT 1
- A Error which blast my mind.... HOT 1
- Yolov5 Int8 export in PyTorch HOT 10
- Video inference with YOLOv5 model in python HOT 3
- How to disable or add new scales of prediction? HOT 5
- Installation on Windows 7 32 bits HOT 3
- Artificial Neural Network - interpreting model.save output HOT 1
- Origin of warmup_bias_lr? HOT 3
- Silicon Mac GPU Support for training HOT 1
- Split features map of data HOT 1
- incorrect detections for cars after fine-tuning yolov5l HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5.