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
a75a614a
"tests/vscode:/vscode.git/clone" did not exist on "2b23ec82e898aa1f0e172da6ef054631634b643d"
Commit
a75a614a
authored
Oct 16, 2020
by
WenmuZhou
Browse files
修复test_loader函数不可用的问题
parent
8c000977
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
tools/train.py
tools/train.py
+9
-6
No files found.
tools/train.py
View file @
a75a614a
...
...
@@ -88,20 +88,23 @@ def main(config, device, logger, vdl_writer):
best_model_dict
,
logger
,
vdl_writer
)
def
test_reader
(
config
,
place
,
logger
):
train_loader
=
build_dataloader
(
config
[
'TRAIN'
],
place
)
def
test_reader
(
config
,
place
,
logger
,
global_config
):
train_loader
,
_
=
build_dataloader
(
config
[
'TRAIN'
],
place
,
global_config
=
global_config
)
import
time
starttime
=
time
.
time
()
count
=
0
try
:
for
data
in
train_loader
()
:
for
data
in
train_loader
:
count
+=
1
if
count
%
1
==
0
:
batch_time
=
time
.
time
()
-
starttime
starttime
=
time
.
time
()
logger
.
info
(
"reader: {}, {}, {}"
.
format
(
count
,
len
(
data
),
batch_time
))
logger
.
info
(
"reader: {}, {}, {}"
.
format
(
count
,
len
(
data
[
0
]
),
batch_time
))
except
Exception
as
e
:
import
traceback
traceback
.
print_exc
()
logger
.
info
(
e
)
logger
.
info
(
"finish reader: {}, Success!"
.
format
(
count
))
...
...
@@ -130,7 +133,7 @@ def dis_main():
device
))
main
(
config
,
device
,
logger
,
vdl_writer
)
# test_reader(config,
pla
ce, logger)
# test_reader(config,
devi
ce, logger
, config['Global']
)
if
__name__
==
'__main__'
:
...
...
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