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
46ff0937
Commit
46ff0937
authored
7 months ago
by
Manon Blanco
Committed by
Solene Tarride
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Weights and Biases integration during training - Initialisation
parent
646805ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!440
Weights and Biases integration during training - Initialisation
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configs/quickstart.json
+1
-0
1 addition, 0 deletions
configs/quickstart.json
dan/ocr/train.py
+9
-0
9 additions, 0 deletions
dan/ocr/train.py
docs/usage/train/config.md
+16
-0
16 additions, 0 deletions
docs/usage/train/config.md
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
with
27 additions
and
0 deletions
configs/quickstart.json
+
1
−
0
View file @
46ff0937
...
...
@@ -8,6 +8,7 @@
"aws_access_key_id"
:
""
,
"aws_secret_access_key"
:
""
},
"wandb"
:
{},
"dataset"
:
{
"datasets"
:
{
"$dataset_name"
:
"$dataset_path"
...
...
This diff is collapsed.
Click to expand it.
dan/ocr/train.py
+
9
−
0
View file @
46ff0937
...
...
@@ -10,6 +10,7 @@ from copy import deepcopy
import
numpy
as
np
import
torch
import
torch.multiprocessing
as
mp
import
wandb
from
dan.ocr.manager.training
import
Manager
from
dan.ocr.mlflow
import
MLFLOW_AVAILABLE
...
...
@@ -106,6 +107,14 @@ def run(config: dict):
"""
Main program, training a new model, using a valid configuration
"""
# Start "Weights & Biases" as soon as possible
if
config
.
get
(
"
wandb
"
):
wandb_config
=
config
[
"
wandb
"
].
pop
(
"
config
"
,
{})
wandb
.
init
(
**
config
[
"
wandb
"
],
config
=
{
**
config
,
**
wandb_config
},
)
names
=
list
(
config
[
"
dataset
"
][
"
datasets
"
].
keys
())
# We should only have one dataset
assert
len
(
names
)
==
1
,
f
"
Found
{
len
(
names
)
}
datasets but only one is expected
"
...
...
This diff is collapsed.
Click to expand it.
docs/usage/train/config.md
+
16
−
0
View file @
46ff0937
...
...
@@ -271,3 +271,19 @@ $ pip install .[mlflow]
|
`mlflow.experiment_id`
| ID of the current experiment in MLFlow. |
`str`
| |
|
`mlflow.aws_access_key_id`
| Access key ID to the AWS server. |
`str`
| |
|
`mlflow.aws_secret_access_key`
| Secret access key to the AWS server. |
`str`
| |
## Weights & Biases logging
To log your experiment on
[
Weights & Biases
](
https://wandb.ai/
)
, you need to:
-
[
login to Weights & Biases
](
https://docs.wandb.ai/ref/cli/wandb-login
)
via
```
shell
wandb login
```
-
update the following arguments:
| Name | Description | Type | Default |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------- |
|
`wandb`
| Key and values to use to initialise your experiment on Weights & Biases. See the full list of available keys on
[
the official documentation
](
https://docs.wandb.ai/ref/python/init
)
. |
`dict`
| |
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
46ff0937
...
...
@@ -33,6 +33,7 @@ dependencies = [
"torchaudio=
=
2.2
.
0
",
"torchvision=
=
0.17
.
0
",
"tqdm=
=
4.65
.
0
",
"wandb=
=
0.17
.
0
",
]
keywords
=
[
"python"
,
"HTR"
,
"OCR"
,
"NER"
,
"machine learning"
,
"pytorch"
]
...
...
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