Plots multiple data sources in yaml doesn't work

Hello I’m following a tutorial in the docs and while trying to make plots work I’ve encountered this problem while writing my dvc yaml file.
Im pretty sure the syntax is correct and the dvc version is “DVC version: 2.42.0 (pip)”

image

I also tried this writing:
plots:

-ROC:
        # Configure template and axes.
        x: fpr
        y:
          eval/live/plots/sklearn/roc/train.json: tpr
          eval/live/plots/sklearn/roc/test.json: tpr
1 Like

Could you elaborate on what error you are getting and from where?

In the first example, plot outputs inside of stages don’t support multiple data sources. They must be “top-level” plots that are separate from your stage outputs. The dvc.yaml should look like:

plots:
  - ROC:
      x: fpr
      y:
        eval/live/plots/sklearn/roc/train.json: tpr
        eval/live/plots/sklearn/roc/test.json: tpr
stages:
...

@mouadAqsone Please don’t hesitate to share your feedback on how we can better clarify this.

@dberenbaum Thanks for the response. For me, placing plots at top level does not seem to fix the issue with multiple data sources in 3.48.0.

metrics:
- models/training_summary/metrics.json
plots:
  - step vs loss:
      template: smooth
      x: step
      y:
        models/training_summary/plots/metrics/train/step/loss.tsv: loss
        models/training_summary/plots/metrics/val/step/loss.tsv: loss
      title: Step Loss
stages:
...

Can you post a fully reproducible example? Copying your dvc.yaml exactly, I’m unable to reproduce the issue:

plot

Hi @dberenbaum, thanks for your reply. Here is the dvc.yaml:

metrics:
- training_summary/metrics.json
plots:
- step vs loss:
    template: smooth
    x: step
    y:
      training_summary/plots/metrics/train/step/loss.tsv: loss
      training_summary/plots/metrics/val/step/loss.tsv: loss
    title: Step val Loss
stages:
  train:
    cmd: python proj/train.py 
      --train_paths ${train.train_paths} 
      --val_paths ${train.val_paths} 
      --model_dir ${train.trained_model_dir}
      --model_file_name ${train.model_file_name}
    outs:
    - models
    - training_summary

dvc 3.48.0
dvc-data 3.13.0
dvc-http 2.32.0
dvc-objects 5.1.0
dvc-render 1.0.1
dvc-studio-client 0.20.0
dvc-task 0.3.0
dvclive 3.44.0

Do these versions match yours?

I’m still unable to reproduce it. Could you share your code as well? Even better would be if you can narrow it down to a simple reproducible script.