Open ReinhardLojewski opened 1 year ago
I have the same issue when running this notebook in google colab. No matter what I change the device to I always get the following error:
ValueError: Invalid CUDA 'device=cuda' requested. Use 'device=cpu' or pass valid CUDA device(s) if available, i.e. 'device=0' or 'device=0,1,2,3' for Multi-GPU.
A quick fix is to import version 0.1.0 from pip.
pip install autodistill-yolov8==0.1.0
Apologies for the friction you ran into getting started. I pushed a change to enable mps acceleration support for YOLOv8 training in Autodistill but the default device configuration wasn't set up properly.
Upgrade to autodistill-yolov8 0.1.3:
pip install --upgrade autodistill-yolov8==0.1.3
Use this code to train:
target_model.train(DATA_YAML_PATH, epochs=50, devices=[0,1...])
Where devices is the list of CUDA device IDs you want to use in training.
Hi @capjamesg , I am importing the YOLOv8Base, but my window system is hanging and doesn't move forward, also it doesn't show any issue. Look like stuck in the import statements. Tested both versions as suggested above.
>>> from autodistill_yolov8 import YOLOv8Base
Just a question: Tried to run the code on windows, and DEVICE overwrote function parameter for self.yolo.train when run with cpu argument on machine with gpu. Is this behaviour intended?
call in main
target_model.train(DATA_YAML_PATH, epochs=2, device = 'cpu')
yolov8.py
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class YOLOv8(DetectionTargetModel): def init(self, model_name): self.yolo = YOLO(model_name)
Best regards, Reinhard