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 metrics show -a" doesn't work if a metric file is missing #1917

Closed
mastaer opened this issue Apr 23, 2019 · 1 comment · Fixed by #1937
Closed

"dvc metrics show -a" doesn't work if a metric file is missing #1917

mastaer opened this issue Apr 23, 2019 · 1 comment · Fixed by #1937
Assignees
Labels
bug Did we break something? p1-important Important, aka current backlog of things to do

Comments

@mastaer
Copy link

mastaer commented Apr 23, 2019

Hi everyone,

I have three branches. Every branch is one experiment. One experiment should create a metric file as output. Two experiments are already finished, the third experiment is still running. So I have two experiments (= branches) with a metric file and one without.

Now I want to use "dvc metrics show -a" to get the result from the two already finished experiments. But I got an error that the branch with the running experiment does not have a metric file.

I am working with the pip installed DVC (version 0.35.7). The system is a ubuntu 18.04 and use anaconda.

I got help from ruslan in the forum: https://discordapp.com/channels/485586884165107732/563406153334128681/570262271847039028

thanks for the help!

cmd: python code/train.py
deps:

  • path: data/toy_3dpatients_on_mrt.npy
  • path: data/toy_3dpatients_on_mrt_settings.npy
  • path: data/toy_3dpatients_on_mrt_test.npy
    outs:
  • cache: false
    metric: true
    path: metrics/test_local_False.json
  • cache: true
    metric: false
    path: tensorboards/test_local_False_test
  • cache: true
    metric: false
    path: tensorboards/test_local_False_train
  • cache: true
    metric: false
    path: tensorflow_models/model_weights_test_local_False.h5

And here is the output from the command dvc metrics show -v -a

(tf-gpu) j@t:~/Documents/gitlab/0005_3d_siamesenet$ dvc metrics show -v -a
ERROR: unexpected error - [Errno 2] No such file in branch 'test_local': 'metrics/test_local_False.json'

Traceback (most recent call last):
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/main.py", line 37, in main
ret = cmd.run_cmd()
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/command/base.py", line 60, in run_cmd
return self.run()
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/command/metrics.py", line 47, in run
recursive=self.args.recursive,
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/repo/metrics/init.py", line 18, in show
return show(self.repo, *args, **kwargs)
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 263, in show
metrics = _read_metrics(self, entries, branch)
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 237, in _read_metrics
fd = self.tree.open(out.path)
File "/home/j/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/dvc/scm/git/tree.py", line 34, in open
raise IOError(errno.ENOENT, msg, relpath)
FileNotFoundError: [Errno 2] No such file in branch 'test_local': 'metrics/test_local_False.json'

@mastaer mastaer changed the title "dvc metrics show -a" should work with not finished experiments. "dvc metrics show -a" should work if a metric file is missing Apr 23, 2019
@mastaer mastaer changed the title "dvc metrics show -a" should work if a metric file is missing "dvc metrics show -a" doesn't work if a metric file is missing Apr 23, 2019
@efiop efiop added bug Did we break something? c3-small-fix p1-important Important, aka current backlog of things to do labels Apr 23, 2019
@pared pared self-assigned this Apr 24, 2019
@efiop
Copy link
Member

efiop commented May 12, 2019

@mastaer The fix for this bug has been released in 0.40.1. Please upgrade. Thanks a lot for this bug report! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something? p1-important Important, aka current backlog of things to do
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants