Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
ab16f2e4
Unverified
Commit
ab16f2e4
authored
Aug 18, 2021
by
dyning
Committed by
GitHub
Aug 18, 2021
Browse files
Merge pull request #3728 from LDOUBLEV/fix_tests
raise error when run on cpu but set use_gpu as True
parents
d1642ed5
30b10d29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
tools/infer/utility.py
tools/infer/utility.py
+5
-0
No files found.
tools/infer/utility.py
View file @
ab16f2e4
...
@@ -159,6 +159,11 @@ def create_predictor(args, mode, logger):
...
@@ -159,6 +159,11 @@ def create_predictor(args, mode, logger):
precision
=
inference
.
PrecisionType
.
Float32
precision
=
inference
.
PrecisionType
.
Float32
if
args
.
use_gpu
:
if
args
.
use_gpu
:
gpu_id
=
get_infer_gpuid
()
if
gpu_id
is
None
:
raise
ValueError
(
"Not found GPU in current device. Please check your device or set args.use_gpu as False"
)
config
.
enable_use_gpu
(
args
.
gpu_mem
,
0
)
config
.
enable_use_gpu
(
args
.
gpu_mem
,
0
)
if
args
.
use_tensorrt
:
if
args
.
use_tensorrt
:
config
.
enable_tensorrt_engine
(
config
.
enable_tensorrt_engine
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment