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
a301e05e
Commit
a301e05e
authored
Jan 20, 2021
by
xmy0916
Browse files
fix bugs
parent
f78ade18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
configs/rec/multi_language/generate_multi_language_configs.py
...igs/rec/multi_language/generate_multi_language_configs.py
+7
-6
No files found.
configs/rec/multi_language/generate_multi_language_configs.py
View file @
a301e05e
...
...
@@ -97,13 +97,18 @@ def merge_config(config):
cur
=
cur
[
sub_key
]
def
loss_file
(
path
):
if
not
os
.
path
.
exists
(
path
):
logging
.
warning
(
'There is no such file:{},Please do not forget to put in the specified file'
.
format
(
path
))
assert
(
os
.
path
.
exists
(
path
)
),
"There is no such file:{},Please do not forget to put in the specified file"
.
format
(
path
)
if
__name__
==
'__main__'
:
FLAGS
=
ArgsParser
().
parse_args
()
merge_config
(
FLAGS
.
opt
)
save_file_path
=
'rec_{}_lite_train.yml'
.
format
(
FLAGS
.
language
)
if
os
.
path
.
isfile
(
save_file_path
):
os
.
remove
(
save_file_path
)
if
FLAGS
.
train
:
global_config
[
'Train'
][
'dataset'
][
'label_file_list'
]
=
[
FLAGS
.
train
]
train_label_path
=
os
.
path
.
join
(
project_path
,
FLAGS
.
train
)
...
...
@@ -122,10 +127,6 @@ if __name__ == '__main__':
data_dir
=
os
.
path
.
join
(
project_path
,
FLAGS
.
data_dir
)
loss_file
(
data_dir
)
save_file_path
=
'rec_{}_lite_train.yml'
.
format
(
FLAGS
.
language
)
if
os
.
path
.
isfile
(
save_file_path
):
os
.
remove
(
save_file_path
)
with
open
(
save_file_path
,
'w'
)
as
f
:
yaml
.
dump
(
dict
(
global_config
),
f
,
default_flow_style
=
False
,
sort_keys
=
False
)
logging
.
info
(
"Project path is :{}"
.
format
(
project_path
))
...
...
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