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
gaoqiong
MIGraphX
Commits
1c6c061b
"...resnet50_tensorflow.git" did not exist on "2de518be2d6a6e3670b223a4582b1353538d3489"
Commit
1c6c061b
authored
May 18, 2023
by
umangyadav
Browse files
Formatting
parent
0a6bc406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
tools/accuracy/accuracy_checker.py
tools/accuracy/accuracy_checker.py
+21
-6
No files found.
tools/accuracy/accuracy_checker.py
View file @
1c6c061b
...
@@ -52,8 +52,14 @@ def parse_args():
...
@@ -52,8 +52,14 @@ def parse_args():
parser
.
add_argument
(
'--fill0'
,
parser
.
add_argument
(
'--fill0'
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'fill all arguments with a value of 0'
)
help
=
'fill all arguments with a value of 0'
)
parser
.
add_argument
(
'--numpy'
,
action
=
'append'
,
help
=
'fill argument with numpy saved array'
,
type
=
str
)
parser
.
add_argument
(
'--numpy'
,
parser
.
add_argument
(
'--np_path'
,
action
=
'append'
,
help
=
'Path for the saved numpy array'
,
type
=
str
)
action
=
'append'
,
help
=
'fill argument with numpy saved array'
,
type
=
str
)
parser
.
add_argument
(
'--np_path'
,
action
=
'append'
,
help
=
'Path for the saved numpy array'
,
type
=
str
)
parser
.
add_argument
(
'--verbose'
,
parser
.
add_argument
(
'--verbose'
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'show verbose information (for debugging)'
)
help
=
'show verbose information (for debugging)'
)
...
@@ -83,7 +89,12 @@ def parse_args():
...
@@ -83,7 +89,12 @@ def parse_args():
action
=
'store_true'
,
action
=
'store_true'
,
default
=
False
,
default
=
False
,
help
=
'Turn on ort VERBOSE logging via session options'
)
help
=
'Turn on ort VERBOSE logging via session options'
)
parser
.
add_argument
(
'--save-ort-res'
,
dest
=
"save_ort"
,
type
=
str
,
help
=
'Save output of ORT as numpy array at path provided by this argument'
)
parser
.
add_argument
(
'--save-ort-res'
,
dest
=
"save_ort"
,
type
=
str
,
help
=
'Save output of ORT as numpy array at path provided by this argument'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
return
args
return
args
...
@@ -191,7 +202,9 @@ def main():
...
@@ -191,7 +202,9 @@ def main():
if
name
in
args
.
numpy
:
if
name
in
args
.
numpy
:
in_path
=
args
.
np_path
[
args
.
numpy
.
index
(
name
)]
in_path
=
args
.
np_path
[
args
.
numpy
.
index
(
name
)]
if
args
.
verbose
:
if
args
.
verbose
:
print
(
"Loading numpy array for input name : {name}, from path : {in_path}"
)
print
(
"Loading numpy array for input name : {name}, from path : {in_path}"
)
test_input
=
np
.
load
(
in_path
).
astype
(
get_np_datatype
(
in_type
))
test_input
=
np
.
load
(
in_path
).
astype
(
get_np_datatype
(
in_type
))
elif
not
args
.
fill1
and
not
args
.
fill0
:
elif
not
args
.
fill1
and
not
args
.
fill0
:
test_input
=
np
.
random
.
rand
(
*
(
in_shape
)).
astype
(
test_input
=
np
.
random
.
rand
(
*
(
in_shape
)).
astype
(
...
@@ -223,9 +236,11 @@ def main():
...
@@ -223,9 +236,11 @@ def main():
try
:
try
:
pred_fw
=
sess
.
run
(
None
,
ort_params
)[
-
1
]
pred_fw
=
sess
.
run
(
None
,
ort_params
)[
-
1
]
if
(
args
.
save_ort
):
if
(
args
.
save_ort
):
if
args
.
verbose
:
if
args
.
verbose
:
print
(
"saving ORT result as numpy array at location : {args.save_ort}"
)
print
(
"saving ORT result as numpy array at location : {args.save_ort}"
)
np
.
save
(
args
.
save_ort
,
pred_fw
)
np
.
save
(
args
.
save_ort
,
pred_fw
)
except
Exception
as
e
:
except
Exception
as
e
:
if
any
(
input_dims
):
if
any
(
input_dims
):
...
...
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