0

I'm trying to run train on GPU

Ultralytics YOLOv8.0.70  Python-3.10.0 torch-2.0.0+cu118 CUDA:0 (NVIDIA GeForce RTX 4070 Ti, 12282MiB)
from ultralytics import YOLO

model = YOLO("yolov8n-seg.pt")

model.train(data="coco128-seg.yaml", epochs=100, batch=1)
metrics = model.val()

It runs with no issues on CPU but with GPU, after first epoch finished, the first epoch runs again and then it will freeze with a message of

RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

Solutions I found suggest setting up num_workers to 0 but I don't use DataLoader as examples in the other posts

talonmies
  • 70,661
  • 34
  • 192
  • 269
qwezxc789
  • 124
  • 1
  • 8

0 Answers0