Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dvc: prevent printing html path #177

Closed
sirily opened this issue Oct 14, 2021 · 2 comments · Fixed by iterative/dvc#6815
Closed

dvc: prevent printing html path #177

sirily opened this issue Oct 14, 2021 · 2 comments · Fixed by iterative/dvc#6815
Assignees
Labels
p1-important Include in the next sprint

Comments

@sirily
Copy link
Contributor

sirily commented Oct 14, 2021

I'm using dvclive with pytorch lightning in dvc pipeline. While training there is a string with the path to metrics html, and it breaks progress bar and fills the console with useless messages. Is there a way to disable printing this line?

Epoch 10: 8%|█▊ | 103/1361 [00:11<02:13, 9.42it/s, loss=1, v_num=_run, train_positive_step=0.988]
file:///path/index.html
Epoch 10: 15%|███▋ | 209/1361 [00:22<02:01, 9.51it/s, loss=1, v_num=_run, train_positive_step=0.985]
file:///path/index.html
Epoch 10: 22%|█████▍ | 305/1361 [00:32<01:50, 9.53it/s, loss=1, v_num=_run, train_positive_step=0.991]
file:///path/index.html
Epoch 10: 29%|███████ | 400/1361 [00:42<01:40, 9.53it/s, loss=1, v_num=_run, train_positive_step=0.984]
file:///path/index.html
Epoch 10: 37%|████████▉ | 505/1361 [00:53<01:29, 9.53it/s, loss=1, v_num=_run, train_positive_step=0.990]
file:///path/index.html

Inside train stage logger is defined like this:

logger = DvcLiveLogger()
model = Trainer(hparams, model_path)
trainer = pl.Trainer(
                    gpus=1,
                    logger=logger,
                    max_epochs=hparams['num_epochs'],
                    log_every_n_steps=hparams['log_every_n_steps'],
                    callbacks=[checkpoint_callback, early_stopping],
                    stochastic_weight_avg=True)

in dvc.yaml stage looks like this:

cmd: python3 pipeline/train.py --task ${item.task} --inp_dir ${item.in} --out_dir ${item.out}
deps:
- data/processed/train_${item.task}_df.par
- data/processed/val_${item.task}_df.par
- models/${item.in}
- pipeline/train.py
- src/trainer.py
params:
- ${item.task}_train
outs:
- models/${item.out}
live:
  metrics/${item.out}_train:
    cache: false
    summary: true
    html: true

It seems like nothing bad happens in dvclive, maybe it prints because of summary path here. But @shcheklein asked me to open an issue here.

dvc doctor:

DVC version: 2.7.4 (pip)


Platform: Python 3.8.10 on Linux-5.4.0-72-generic-x86_64-with-glibc2.29
Supports:
hdfs (pyarrow = 5.0.0),
http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
s3 (s3fs = 2021.8.1, boto3 = 1.17.106)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/mapper/vg0-root
Caches: local
Remotes: s3
Workspace directory: ext4 on /dev/mapper/vg0-root
Repo: dvc (subdir), git

dvclive version: 0.4.1

@sirily sirily changed the title dvc: prevent printing html path prevent printing html path Oct 14, 2021
@daavoo
Copy link
Contributor

daavoo commented Oct 14, 2021

Thanks for the report @sirily !

You are right, the html path is being printed by DVC. Maybe we can lower the logging level from info to debug and/or only print the html path once, at the beginning of training, instead of at the end of each epoch.

@daavoo daavoo changed the title prevent printing html path dvc: prevent printing html path Oct 14, 2021
@daavoo daavoo added the p1-important Include in the next sprint label Oct 15, 2021
@daavoo daavoo self-assigned this Oct 15, 2021
daavoo added a commit to iterative/dvc that referenced this issue Oct 26, 2021
Writing at the end of each step (create_summary) can mess up with some ML Framework progress bars, I moved the message to the monitor task, as the path won't change during training.

Fixes iterative/dvclive#177
daavoo added a commit to iterative/dvc that referenced this issue Oct 27, 2021
Writing at the end of each step (create_summary) can mess up with some ML Framework progress bars, I moved the message to the monitor task, as the path won't change during training.

Fixes iterative/dvclive#177
pared pushed a commit to iterative/dvc that referenced this issue Oct 29, 2021
Writing at the end of each step (create_summary) can mess up with some ML Framework progress bars, I moved the message to the monitor task, as the path won't change during training.

Fixes iterative/dvclive#177
@daavoo
Copy link
Contributor

daavoo commented Oct 29, 2021

Hei @sirily the fix will be shipped in the next DVC release. It has been already merged so you could install from pre-release version for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-important Include in the next sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants