Skip to content

Commit

Permalink
Add device check in check_gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
TracebaK committed Nov 29, 2023
1 parent a0901d2 commit 6ddac52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/infer/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def get_minarea_rect_crop(img, points):


def check_gpu(use_gpu):
if use_gpu and not paddle.is_compiled_with_cuda():
if use_gpu and (not paddle.is_compiled_with_cuda() or paddle.device.get_device() == 'cpu'):
use_gpu = False
return use_gpu

Expand Down

0 comments on commit 6ddac52

Please sign in to comment.