-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 exp show --json
produces error that disables VS Code Extension from tracking experiments
#9565
Comments
dvc exp show --json
produces error that disables VS Code Extension from tracking experimentsdvc exp show --json
produces error that disables VS Code Extension from tracking experiments
This is actually a core python bug which has been fixed in some releases but has not been backported to a 3.9 release yet. We have a workaround for it here: dvc/dvc/repo/experiments/serialize.py Lines 59 to 71 in ed66414
but I'm guessing this issue means we need to make the |
I'm facing the same issue, it happens even with python 3.10. Are there any workarounds at the moment? |
@pmrowla Is it expected that it would still happen with 3.10? |
@Danila89 hey, could you please also share a bit more information - |
@shcheklein seems that the problem depends on what exactly the experiments look like. I'm exploring DVC capabilities, I delete and run a lot of experiments. At some point in time I encountered the issue. Vscode extension did not work, |
@mattseddon reported that he can reproduce it with python 3.10 in #9588 (comment). Looking into it. Update: looks like a regression from ec090c5. |
This will happen in Python <3.12. |
@skshetry I think it's actually Python<3.11.0, right? |
AFAICT the default dicts are only nested one level deep, so I put a quick fix PR in #9619. @skshetry @pmrowla Any issues with this quick fix? @TeamEpimicro If you want to try, you could do |
No, it was fixed only in 3.12. See python/cpython#32056. i can still repro in 3.11 using: from collections import defaultdict
from dataclasses import asdict, dataclass, field
@dataclass
class Klass:
d: dict[str, list[int]] = field(default_factory=dict)
d = defaultdict(list, {"lst": [1, 2, 3]})
inst = Klass(d=d)
print(asdict(inst)) |
Closing as fixed by #9619. @TeamEpimicro @Danila89 Please follow up if you still have issues. |
Bug Report
dvc exp show --json : ERROR: unexpected error - first argument must be callable or None
Description
I am currently using the VS Code extension with version v0.9.6 and dvc with version v2.58.2 (see
dvc doctor
output below).My
.dvc/config
file is the following:My VS Code Extension is showing "No experiment to display" in the Experiments tab of the left sidebar.
In addition, the Experiment tab in the Setup view of the DVC extension says: "Your project contains no data"
As a result, I am unable to use the VS Code Extension.
However I already ran of couple of experiments through
dvc exp run
and pushed the associateddvc.lock
files to my git repo, which I can successfully track through the CLI withdvc exp show --rev master
:I found an error in the VS Code Developper Console :
exp show --rev master -n 3 --json failed with ERROR: unexpected error - first argument must be callable or None
The same error is displayed when running
dvc exp show --json
in the CLI :Here is the same command ran with
--verbose
:Reproduce
git init
dvc init
dvc exp run
dvc push
git add dvc.lock
git commit -m "some commit name"
git push
dvc exp show --json
Expected
No error is expected.
Environment information
Output of
dvc doctor
:I am using poetry for package and environment management.
Output of
pip check
:Output of
poetry check
:Output of
poetry env info
:Output of
poetry show dvc
:Additionnal Information
I am instantiating dvclive in my code with the following :
And tracking some metrics with both
live.summary()
andlive.log_metric()
:The text was updated successfully, but these errors were encountered: