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
bbe37535
Commit
bbe37535
authored
Oct 27, 2020
by
WenmuZhou
Browse files
删除check_static函数
parent
122c82e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
38 deletions
+1
-38
ppocr/modeling/architectures/model.py
ppocr/modeling/architectures/model.py
+1
-38
No files found.
ppocr/modeling/architectures/model.py
View file @
bbe37535
...
@@ -21,7 +21,6 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -21,7 +21,6 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
'/home/zhoujun20/PaddleOCR'
)
sys
.
path
.
append
(
'/home/zhoujun20/PaddleOCR'
)
import
paddle
from
paddle
import
nn
from
paddle
import
nn
from
ppocr.modeling.transform
import
build_transform
from
ppocr.modeling.transform
import
build_transform
from
ppocr.modeling.backbones
import
build_backbone
from
ppocr.modeling.backbones
import
build_backbone
...
@@ -84,39 +83,3 @@ class Model(nn.Layer):
...
@@ -84,39 +83,3 @@ class Model(nn.Layer):
x
=
self
.
neck
(
x
)
x
=
self
.
neck
(
x
)
x
=
self
.
head
(
x
)
x
=
self
.
head
(
x
)
return
x
return
x
\ No newline at end of file
def
check_static
():
import
numpy
as
np
from
ppocr.utils.save_load
import
load_dygraph_pretrain
from
ppocr.utils.logging
import
get_logger
from
tools
import
program
config
=
program
.
load_config
(
'configs/det/det_r50_vd_db.yml'
)
logger
=
get_logger
()
np
.
random
.
seed
(
0
)
data
=
np
.
random
.
rand
(
1
,
3
,
640
,
640
).
astype
(
np
.
float32
)
paddle
.
disable_static
()
x
=
paddle
.
to_tensor
(
data
)
config
[
'Architecture'
][
'in_channels'
]
=
3
config
[
'Architecture'
][
"Head"
][
'out_channels'
]
=
37
model
=
Model
(
config
[
'Architecture'
])
model
.
eval
()
load_dygraph_pretrain
(
model
,
logger
,
'det_r50_vd_db/best_accuracy'
,
load_static_weights
=
True
)
y
=
model
(
x
)
for
y1
in
y
:
print
(
y1
.
shape
)
static_out
=
np
.
load
(
'static_out.npy'
)
diff
=
y
.
numpy
()
-
static_out
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
if
__name__
==
'__main__'
:
check_static
()
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