dvc: '.../plots/metrics/metrics' - file type error

Using the dvclive.lightning.DVCLiveLogger with dir="data/train/dvclive", I can see the plots of the metrics in the “Plots” view of the VS Code DVC extension. But at the top where it shows the selected experiments, it displays an error with message:

‘data/train/dvclive/plots/metrics/metrics’ - file type error Only JSON, YAML, CSV and TSV formats are supported.

The summary metrics are stored in data/train/dvclive/metrics.json and the .tsv files of the logged metrics are in data/train/dvclive/plots/metrics/. There exists no file named metrics without extension inside this folder.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

It only happens when dvc.lock is missing, in which case dvc_data.fs.DataFileSystem.ls(data/train/plots/metrics) does not know if data/train/plots/metrics is a directory or file here. It assumes it is a file and dvc_data.fs.DataFileSystem.ls("data/train/plots/metrics") returns itself. LocalFileSystem.ls(path) only returns subpaths and fails if path is a file, so not sure if it’s expected that dvc_data.fs.DataFileSystem.ls(path) returns path itself. cc @efiop

Yes, dvc plots diff also reports this error. Though both in the CLI output and VS Code Extension “Plots” view the path is now “data/train/plots/metrics” (which is the correct path) after I merged some code and run some trial experiments to test my DVC + Ray + AWS setup.

$ dvc plots diff --json
DVC failed to load some plots for following revisions: 'workspace, HEAD'.                                                                                                                                                                                                                                                                                                                         
{
  "errors": [
    {
      "name": "data/train/plots/metrics",
      "rev": "workspace",
      "source": "data/train/plots/metrics",
      "type": "PlotMetricTypeError",
      "msg": "'data/train/plots/metrics' - file type error\nOnly JSON, YAML, CSV and TSV formats are supported."
    },
    {
      "name": "data/train/plots/metrics",
      "rev": "HEAD",
      "source": "data/train/plots/metrics",
      "type": "PlotMetricTypeError",
      "msg": "'data/train/plots/metrics' - file type error\nOnly JSON, YAML, CSV and TSV formats are supported."
    }
  ],
  "data": {
    "data/train/plots/metrics": []
  }
}

This was after I started a new run with dvc exp run (using the extension’s “Run Experiment” button). My base commit has no valid train stage output as I just set up the experiment pipeline with DVCLive.