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
ModelZoo
ResNet50_tensorflow
Commits
87a4dcc3
Unverified
Commit
87a4dcc3
authored
Apr 26, 2018
by
Karmel Allison
Committed by
GitHub
Apr 26, 2018
Browse files
Update unit for workspace size. (#4094)
parent
de9f3584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
research/tensorrt/tensorrt.py
research/tensorrt/tensorrt.py
+5
-5
No files found.
research/tensorrt/tensorrt.py
View file @
87a4dcc3
...
...
@@ -215,7 +215,7 @@ def get_tftrt_name(graph_name, precision_string):
def
get_trt_graph
(
graph_name
,
graph_def
,
precision_mode
,
output_dir
,
output_node
,
batch_size
=
128
,
workspace_size
=
1
<<
3
0
):
output_node
,
batch_size
=
128
,
workspace_size
=
2
<<
1
0
):
"""Create and save inference graph using the TensorRT library.
Args:
...
...
@@ -227,14 +227,14 @@ def get_trt_graph(graph_name, graph_def, precision_mode, output_dir,
output_node: string, the names of the output node that will
be returned during inference.
batch_size: int, the number of examples that will be predicted at a time.
workspace_size:
long
, size in bytes that can be used during conversion.
workspace_size:
int
, size in
mega
bytes that can be used during conversion.
Returns:
GraphDef for the TensorRT inference graph.
"""
trt_graph
=
trt
.
create_inference_graph
(
graph_def
,
[
output_node
],
max_batch_size
=
batch_size
,
max_workspace_size_bytes
=
workspace_size
,
max_workspace_size_bytes
=
workspace_size
<<
20
,
precision_mode
=
precision_mode
)
write_graph_to_file
(
graph_name
,
trt_graph
,
output_dir
)
...
...
@@ -589,8 +589,8 @@ class TensorRTParser(argparse.ArgumentParser):
)
self
.
add_argument
(
"--workspace_size"
,
"-ws"
,
type
=
long
,
default
=
2
<<
3
0
,
help
=
"[default: %(default)s] Workspace size in bytes."
,
"--workspace_size"
,
"-ws"
,
type
=
int
,
default
=
2
<<
1
0
,
help
=
"[default: %(default)s] Workspace size in
mega
bytes."
,
metavar
=
"<WS>"
)
...
...
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