Segmentation Fault When Creating YOLO Model

Hi everyone,

I’m encountering a Segmentation fault (core dumped) error when trying to create a YOLO model inside a Docker container with the following code:

model = YOLO("yolov8n.pt")

Here’s my Docker setup:

FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-runtime
ultralytics==8.3.6
ultralytics-thop==2.0.9

Has anyone faced this issue or know how to resolve it? Any suggestions would be appreciated!

Thanks in advance!

@iyed_ben_aicha it’s a bit difficult without the full error log, but my suggestion would be to start from the official Ultralytics Docker image instead of the PyTorch one. You can get it using the command:

docker pull ultralytics/ultralytics:latest

or you can build the image locally using the Dockerfile from the repository. Try using one of these options and if the error persists, please provide the following:

  • The full error log
  • Output from running the CLI command yolo checks

As an FYI, here are two posts with some advice on getting support (which admittedly need to be expanded on):