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
e2ed89fa
Unverified
Commit
e2ed89fa
authored
Sep 26, 2021
by
Double_V
Committed by
GitHub
Sep 26, 2021
Browse files
Merge pull request #4173 from MissPenguin/dygraph
fix rec cpp infer with trt
parents
a224dcac
6e6ae26a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
deploy/cpp_infer/src/ocr_rec.cpp
deploy/cpp_infer/src/ocr_rec.cpp
+8
-4
No files found.
deploy/cpp_infer/src/ocr_rec.cpp
View file @
e2ed89fa
...
@@ -112,12 +112,16 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
...
@@ -112,12 +112,16 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
1
<<
20
,
10
,
3
,
1
<<
20
,
10
,
3
,
precision
,
precision
,
false
,
false
);
false
,
false
);
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
min_input_shape
=
{
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
min_input_shape
=
{
{
"x"
,
{
1
,
3
,
32
,
10
}}};
{
"x"
,
{
1
,
3
,
32
,
10
}},
{
"lstm_0.tmp_0"
,
{
10
,
1
,
96
}}};
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
max_input_shape
=
{
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
max_input_shape
=
{
{
"x"
,
{
1
,
3
,
32
,
2000
}}};
{
"x"
,
{
1
,
3
,
32
,
2000
}},
{
"lstm_0.tmp_0"
,
{
1000
,
1
,
96
}}};
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
opt_input_shape
=
{
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
opt_input_shape
=
{
{
"x"
,
{
1
,
3
,
32
,
320
}}};
{
"x"
,
{
1
,
3
,
32
,
320
}},
{
"lstm_0.tmp_0"
,
{
25
,
1
,
96
}}};
config
.
SetTRTDynamicShapeInfo
(
min_input_shape
,
max_input_shape
,
config
.
SetTRTDynamicShapeInfo
(
min_input_shape
,
max_input_shape
,
opt_input_shape
);
opt_input_shape
);
...
@@ -139,7 +143,7 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
...
@@ -139,7 +143,7 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
config
.
SwitchIrOptim
(
true
);
config
.
SwitchIrOptim
(
true
);
config
.
EnableMemoryOptim
();
config
.
EnableMemoryOptim
();
config
.
DisableGlogInfo
();
//
config.DisableGlogInfo();
this
->
predictor_
=
CreatePredictor
(
config
);
this
->
predictor_
=
CreatePredictor
(
config
);
}
}
...
...
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