Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
3f79df13
Commit
3f79df13
authored
1 year ago
by
Mélodie
Browse files
Options
Downloads
Patches
Plain Diff
Apply
5a7dd7ef
parent
e93f4892
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dan/ocr/document/train.py
+5
-5
5 additions, 5 deletions
dan/ocr/document/train.py
with
5 additions
and
5 deletions
dan/ocr/document/train.py
+
5
−
5
View file @
3f79df13
...
...
@@ -258,18 +258,18 @@ def serialize_config(config):
return
serialized_config
def
start_training
(
config
)
->
None
:
def
start_training
(
config
,
mlflow_logging
:
bool
)
->
None
:
if
(
config
[
"
training_params
"
][
"
use_ddp
"
]
and
not
config
[
"
training_params
"
][
"
force_cpu
"
]
):
mp
.
spawn
(
train_and_test
,
args
=
(
config
,
True
),
args
=
(
config
,
mlflow_logging
),
nprocs
=
config
[
"
training_params
"
][
"
nb_gpu
"
],
)
else
:
train_and_test
(
0
,
config
,
True
)
train_and_test
(
0
,
config
,
mlflow_logging
)
def
run
():
...
...
@@ -286,7 +286,7 @@ def run():
raise
MLflowNotInstalled
()
if
"
mlflow
"
not
in
config
:
start_training
(
config
)
start_training
(
config
,
mlflow_logging
=
False
)
else
:
labels_path
=
(
Path
(
config
[
"
dataset_params
"
][
"
datasets
"
][
dataset_name
])
/
"
labels.json
"
...
...
@@ -314,4 +314,4 @@ def run():
dictionary
=
artifact
,
artifact_file
=
filename
,
)
start_training
(
config
)
start_training
(
config
,
mlflow_logging
=
True
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment