'Stop printing warning message "Using CPU. Note: This module is much faster with a GPU."

I am running a Python program using the excellent EasyOCR module. It relies on PyTorch for image detection and every time I run it, it produces a warning: "Using CPU. Note: This module is much faster with a GPU." for each iteration.

What can I add to my code to stop this output without stopping other output? I don't have a GPU so that is not an option.



Solution 1:[1]

After looking into the source code, I noticed that verbose is set to True by default in the constructor.

After setting verbose=False the message stops appearing.

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

Solution 2:[2]

I think there is a command line parameter --gpu=false. Have you tried that?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wovano
Solution 2 Kilian