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
08b3f98c
"...composable_kernel_onnx.git" did not exist on "85978e0201bb94bf6e59b325e1f5f19266845d08"
Commit
08b3f98c
authored
Oct 22, 2020
by
WenmuZhou
Browse files
去掉注释
parent
7c96520d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
ppocr/modeling/architectures/model.py
ppocr/modeling/architectures/model.py
+10
-12
No files found.
ppocr/modeling/architectures/model.py
View file @
08b3f98c
...
@@ -76,7 +76,6 @@ class Model(nn.Layer):
...
@@ -76,7 +76,6 @@ class Model(nn.Layer):
config
[
"Head"
][
'in_channels'
]
=
in_channels
config
[
"Head"
][
'in_channels'
]
=
in_channels
self
.
head
=
build_head
(
config
[
"Head"
])
self
.
head
=
build_head
(
config
[
"Head"
])
# @paddle.jit.to_static
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
if
self
.
use_transform
:
if
self
.
use_transform
:
x
=
self
.
transform
(
x
)
x
=
self
.
transform
(
x
)
...
@@ -93,30 +92,29 @@ def check_static():
...
@@ -93,30 +92,29 @@ def check_static():
from
ppocr.utils.logging
import
get_logger
from
ppocr.utils.logging
import
get_logger
from
tools
import
program
from
tools
import
program
config
=
program
.
load_config
(
'configs/
rec/rec_mv3_none_none_ctc_lm
db.yml'
)
config
=
program
.
load_config
(
'configs/
det/det_r50_vd_
db.yml'
)
logger
=
get_logger
()
logger
=
get_logger
()
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
data
=
np
.
random
.
rand
(
2
,
3
,
64
,
320
).
astype
(
np
.
float32
)
data
=
np
.
random
.
rand
(
1
,
3
,
640
,
640
).
astype
(
np
.
float32
)
paddle
.
disable_static
()
paddle
.
disable_static
()
x
=
paddle
.
to_tensor
(
data
)
config
[
'Architecture'
][
'in_channels'
]
=
3
config
[
'Architecture'
][
'in_channels'
]
=
3
config
[
'Architecture'
][
"Head"
][
'out_channels'
]
=
6624
config
[
'Architecture'
][
"Head"
][
'out_channels'
]
=
37
model
=
Model
(
config
[
'Architecture'
])
model
=
Model
(
config
[
'Architecture'
])
model
.
eval
()
model
.
eval
()
load_dygraph_pretrain
(
load_dygraph_pretrain
(
model
,
model
,
logger
,
'det_r50_vd_db/best_accuracy'
,
load_static_weights
=
True
)
logger
,
'/Users/zhoujun20/Desktop/code/PaddleOCR/cnn_ctc/cnn_ctc'
,
load_static_weights
=
True
)
x
=
paddle
.
to_tensor
(
data
)
y
=
model
(
x
)
y
=
model
(
x
)
for
y1
in
y
:
for
y1
in
y
:
print
(
y1
.
shape
)
print
(
y1
.
shape
)
static_out
=
np
.
load
(
static_out
=
np
.
load
(
'static_out.npy'
)
'/Users/zhoujun20/Desktop/code/PaddleOCR/output/conv.npy'
)
diff
=
y
.
numpy
()
-
static_out
diff
=
y
.
reshape
((
-
1
,
6624
)).
numpy
()
-
static_out
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
...
...
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