quantized-yolov5
quantized-yolov5 copied to clipboard
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
I encountered the following error while reproducing your code:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
The specific details are as follows: Plotting labels... Image sizes 640 train, 640 val Using 8 dataloader workers Logging results to runs/train/exp Starting training for 300 epochs...
Epoch gpu_mem box obj cls labels img_size
0%| | 0/183 [00:02<?, ?it/s]
Traceback (most recent call last):
File "/data/master21/zhujh/software/pythonProject/quantized-yolov5-quantized_yolo/train.py", line 653, in
Process finished with exit code 1
May I ask if there is a good and effective solution,thanks.
👋 Hello @zjhleaning, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.
For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at [email protected].
Requirements
Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt
Environments
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
-
Google Colab and Kaggle notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
-
Docker Image. See Docker Quickstart Guide
Status
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
how about check your device?it's seems that you have a gpu and a cup ,maybe your device get wrong