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_onnxruntime_migraphx
Commits
25e4f86c
"vscode:/vscode.git/clone" did not exist on "9426aae55a827d92e677b93d00bf8c1a54cbcd34"
Commit
25e4f86c
authored
Jan 08, 2025
by
liucong
Browse files
修改python示例程序
parent
3e7e503b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Python/Classifier.py
Python/Classifier.py
+11
-3
No files found.
Python/Classifier.py
View file @
25e4f86c
...
...
@@ -68,10 +68,18 @@ def ort_seg_dcu(model_path,image,staticInfer,dynamicInfer):
provider_options
=
[{
'device_id'
:
'0'
,
'migraphx_fp16_enable'
:
'true'
,
'dynamic_model'
:
'true'
,
'migraphx_profile_max_shapes'
:
'data:1x3x224x224'
}]
dcu_session
=
ort
.
InferenceSession
(
model_path
,
providers
=
[
'MIGraphXExecutionProvider'
],
provider_options
=
provider_options
)
input_name
=
dcu_session
.
get_inputs
()[
0
].
name
results
=
dcu_session
.
run
(
None
,
input_feed
=
{
input_name
:
image
})
scores
=
np
.
array
(
results
[
0
])
images
=
[
image
]
input_nodes
=
dcu_session
.
get_inputs
()
input_names
=
[
i_n
.
name
for
i_n
in
input_nodes
]
output_nodes
=
dcu_session
.
get_outputs
()
output_names
=
[
o_n
.
name
for
o_n
in
output_nodes
]
input_dict
=
{}
for
i_d
,
i_n
in
zip
(
images
,
input_names
):
input_dict
[
i_n
]
=
i_d
result
=
dcu_session
.
run
([],
input_dict
)
scores
=
np
.
array
(
result
[
0
])
print
(
"ort result.shape:"
,
scores
.
shape
)
return
scores
...
...
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