[Python] Roboflow device management. In which GPU is the model loaded?

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I am experimenting with the SDK of Roboflow, I haven't found documentation on device management. I have three questions:

    1. Is the model loaded to GPU by default?
    2. What happens when multiple GPUs are available?
    3. And how do I define in which GPU I want the model allocated?

    EDIT:

    Roboflow does not expose the device directly as Pytorch would:

    rf = Roboflow(api_key="YOUR API KEY")
    project = rf.workspace().project("license-plate-recognition-rxg4e")
    model = project.version("4").model
    model = model.to("cuda:4")
    > AttributeError: 'ObjectDetectionModel' object has no attribute 'to'

    Continue reading...

Compartilhe esta Página