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

Experiments are not shown when baseline commit has an error #5036

Closed
Danila89 opened this issue Nov 28, 2023 · 2 comments · Fixed by #5041
Closed

Experiments are not shown when baseline commit has an error #5036

Danila89 opened this issue Nov 28, 2023 · 2 comments · Fixed by #5041
Assignees

Comments

@Danila89
Copy link

Description

When keeping dvc experiments outside from the main branch, vscode extension fails to show experiments while main branch is active ("Your project contains no data" error is shown).
The issue arises when hydra is used, but up-to-date params.yaml is not present in the current branch.

Reproduce

  1. git clone https://github.com/Danila89/dvc_empty.git
  2. cd dvc_empty && dvc exp pull origin -A --no-cache
  3. At this point we expect to see non-empty "Experiments" tab in VSCode extension (there is one dvc experiment at the repo). But "Your project contains no data" will be shown in VSCode extension
  4. To ensure that experiment actually exists: git fetch origin exp1-branch && git checkout --track origin/exp1-branch. This command will populate Experiments tab in VSCode extension with the experiment
  5. git checkout master will make Experiments tab empty again

Environment information

Output of dvc doctor:

(base) danila.savenkov@RS-UNIT-0099 dvc_empty % dvc doctor
DVC version: 3.30.1 (pip)
-------------------------
Platform: Python 3.10.9 on macOS-13.3.1-arm64-arm-64bit
Subprojects:
        dvc_data = 2.22.1
        dvc_objects = 1.2.0
        dvc_render = 0.5.3
        dvc_task = 0.3.0
        scmrepo = 1.5.0
Supports:
        http (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
        https (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
        s3 (s3fs = 2023.5.0, boto3 = 1.26.76)
Config:
        Global: /Users/danila.savenkov/Library/Application Support/dvc
        System: /Library/Application Support/dvc
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: None
Workspace directory: apfs on /dev/disk3s3s1
Repo: dvc, git
Repo.site_cache_dir: /Library/Caches/dvc/repo/446173993f470ed3f55e59a2478cfe4e

Output of dvc exp show -n 3 --json:

(base) danila.savenkov@RS-UNIT-0099 dvc_empty % dvc exp show -n 3 --json
[
  {
    "rev": "workspace",
    "name": null,
    "data": null,
    "error": {
      "msg": "failed to parse 'stages.main.cmd' in 'dvc.yaml': Could not find 'parameters.parameter_name'",
      "type": "ResolveError"
    },
    "experiments": null
  },
  {
    "rev": "616500724541bcd2f7f89584187b00f838ecf9a9",
    "name": "master",
    "data": null,
    "error": {
      "msg": "failed to parse 'stages.main.cmd' in 'dvc.yaml': Could not find 'parameters.parameter_name'",
      "type": "ResolveError"
    },
    "experiments": [
      {
        "revs": [
          {
            "rev": "ee23879da223ff9d5bd906bdd8969cc0ea90344f",
            "name": "exp1",
            "data": {
              "rev": "ee23879da223ff9d5bd906bdd8969cc0ea90344f",
              "timestamp": "2023-11-28T16:07:17",
              "params": {
                "params.yaml": {
                  "data": {
                    "parameters": {
                      "parameter_name": "parameter_value"
                    }
                  }
                },
                "dvclive/params.yaml": {
                  "data": {
                    "result": 0.6936822634315442
                  }
                }
              },
              "metrics": {},
              "deps": {},
              "outs": {},
              "meta": {}
            },
            "error": null,
            "experiments": null
          }
        ],
        "executor": null,
        "name": "exp1"
      }
    ]
  },
  {
    "rev": "7d527bc6ae94befdc9352e59d80b133cdb0a1e7a",
    "name": null,
    "data": {
      "rev": "7d527bc6ae94befdc9352e59d80b133cdb0a1e7a",
      "timestamp": "2023-11-28T15:57:50",
      "params": {},
      "metrics": {},
      "deps": {},
      "outs": {},
      "meta": {}
    },
    "error": null,
    "experiments": null
  },
  {
    "rev": "19825884a7acacc3177716c8fd7b2502ed129c59",
    "name": null,
    "data": {
      "rev": "19825884a7acacc3177716c8fd7b2502ed129c59",
      "timestamp": "2023-11-28T13:09:17",
      "params": {},
      "metrics": {},
      "deps": {},
      "outs": {},
      "meta": {}
    },
    "error": null,
    "experiments": null
  }
]
@mattseddon mattseddon transferred this issue from iterative/dvc Nov 28, 2023
@mattseddon mattseddon self-assigned this Nov 28, 2023
@mattseddon
Copy link
Member

mattseddon commented Nov 28, 2023

@Danila89

In the data for the current commit on master you have an error instead of data:

    "error": {
      "msg": "failed to parse 'stages.main.cmd' in 'dvc.yaml': Could not find 'parameters.parameter_name'",
      "type": "ResolveError"
    }

The extension could be showing "your project has no data" instead of the error which would be a bug.

Thanks for providing the repo should make things easier to solve. I'll be taking a deeper look shortly.

@Danila89
Copy link
Author

Just to mention: the nature of this error is kind of obvious (master branch does not know about parameters.parameter_name because of the lack of params.yaml. But the error does not prevent dvc exp show correct work and I wish that it won't prevent VSCode extension correct work as well.
Seems that this issue could be related (also about errors with hydra and params.yaml)

@mattseddon mattseddon changed the title VSCode extension: extension does not show any experiments when active branch does not have experiments while other branches do Experiments are not shown when baseline commit has an error Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants