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
30a8efce
Verified
Commit
30a8efce
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
more logs
parent
04ca87e2
No related branches found
No related tags found
1 merge request
!60
Resume from existing mlflow run
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dan/manager/training.py
+0
-7
0 additions, 7 deletions
dan/manager/training.py
dan/mlflow.py
+4
-2
4 additions, 2 deletions
dan/mlflow.py
dan/ocr/document/train.py
+7
-4
7 additions, 4 deletions
dan/ocr/document/train.py
with
11 additions
and
13 deletions
dan/manager/training.py
+
0
−
7
View file @
30a8efce
...
...
@@ -31,13 +31,6 @@ try:
except
ImportError
:
pass
try
:
import
mlflow
from
dan.mlflow
import
logging_metrics
,
logging_tags_metrics
except
ImportError
:
pass
class
GenericTrainingManager
:
def
__init__
(
self
,
params
):
...
...
This diff is collapsed.
Click to expand it.
dan/mlflow.py
+
4
−
2
View file @
30a8efce
...
...
@@ -91,7 +91,9 @@ def logging_tags_metrics(
@contextmanager
def
start_mlflow_run
(
config
:
dict
):
"""
Create an MLflow execution context with the parameters contained in the config file
Create an MLflow execution context with the parameters contained in the config file.
Yields the active MLflow run, as well as a boolean saying whether a new one was created.
:param config: dict, the config of the model
"""
...
...
@@ -116,5 +118,5 @@ def start_mlflow_run(config: dict):
# Start run
yield
mlflow
.
start_run
(
run_id
=
run_id
,
run_name
=
run_name
,
experiment_id
=
experiment_id
)
)
,
run_id
is
None
mlflow
.
end_run
()
This diff is collapsed.
Click to expand it.
dan/ocr/document/train.py
+
7
−
4
View file @
30a8efce
...
...
@@ -304,11 +304,14 @@ def run():
labels_path
=
(
Path
(
config
[
"
dataset_params
"
][
"
datasets
"
][
dataset_name
])
/
"
labels.json
"
)
with
start_mlflow_run
(
config
[
"
mlflow
"
])
as
run
:
logger
.
info
(
f
"
Started MLflow run with ID (
{
run
.
info
.
run_id
}
)
"
)
with
start_mlflow_run
(
config
[
"
mlflow
"
])
as
(
run
,
created
):
if
created
:
logger
.
info
(
f
"
Started MLflow run with ID (
{
run
.
info
.
run_id
}
)
"
)
else
:
logger
.
info
(
f
"
Resumed MLflow run with ID (
{
run
.
info
.
run_id
}
)
"
)
make_mlflow_request
(
mlflow_method
=
mlflow
.
set_tags
,
tags
=
{
"
Dataset
"
:
dataset_name
}
mlflow_method
=
mlflow
.
set_tags
,
tags
=
{
"
Dataset
"
:
dataset_name
}
)
# Get the labels json file
with
open
(
labels_path
)
as
json_file
:
...
...
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