[Python] "UserWarning: 'pin_memory' argument is set as true but no accelerator is found, then...

Discussão em 'Python' iniciado por Stack, Maio 20, 2025.

  1. Stack

    Stack Membro Participativo

    i am trying to use easyocr,

    ` reader = easyocr.Reader(['en'], gpu=False)

    def read_sign(sign): result = reader.readtext(sign) return 'STOP' in result`

    however while it did work at the start it no longer works and shows me the following error:

    AppData\Local\Programs\Python\Python313\Lib\site-packages\torch\utils\data\dataloader.py:665: UserWarning: 'pin_memory' argument is set as true but no accelerator is found, then device pinned memory won't be used.

    i followed the issue to the Dataloader class, where pin_memory is set to False. I have not found any information regarding that error anywhere.

    def __init__( self, dataset: Dataset[_T_co], batch_size: Optional[int] = 1, shuffle: Optional[bool] = None, sampler: Union[Sampler, Iterable, None] = None, batch_sampler: Union[Sampler
    • , Iterable
      • , None] = None, num_workers: int = 0, collate_fn: Optional[_collate_fn_t] = None, pin_memory: bool = False, drop_last: bool = False, timeout: float = 0, worker_init_fn: Optional[_worker_init_fn_t] = None, multiprocessing_context=None, generator=None, *, prefetch_factor: Optional[int] = None, persistent_workers: bool = False, pin_memory_device: str = "", in_order: bool = True, ): torch._C._log_api_usage_once("python.data_loader")

        Continue reading...

Compartilhe esta Página