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

[App]: No Selected Runs have Saved Code #7426

Open
seyuboglu opened this issue Apr 19, 2024 · 3 comments
Open

[App]: No Selected Runs have Saved Code #7426

seyuboglu opened this issue Apr 19, 2024 · 3 comments
Labels
a:app Area: Frontend/Backend

Comments

@seyuboglu
Copy link

seyuboglu commented Apr 19, 2024

Current Behavior

I see the following error message when trying to compare code across runs, even though the selected runs do indeed have saved code

image

Expected Behavior

I'd expect something to show up in the panel

Steps To Reproduce

I'm logging code using

run.log_code(
            root=os.path.dirname(os.path.dirname(__file__)),
            name="project_name",
            include_fn=lambda path, root: path.endswith(".py")       
)

Environment

OS: Mac

Browsers: Arc

Version:

@seyuboglu
Copy link
Author

seyuboglu commented Apr 19, 2024

In case it's useful to anyone stumbling upon this same issue, I've just been using this as a workaround to compare code for now:

def compare_runs(run_id_a: str, run_id_b: str,):
    import tempfile
    import os
    import subprocess

    with tempfile.TemporaryDirectory() as tmp_dir:
        api = wandb.Api()
        code_dirs = []
        for run_id in [run_id_a, run_id_b]:
            run = api.run(run_id)

            code_artifacts = [x for x in run.logged_artifacts() if x.type == "code"]

            if len(code_artifacts) == 0:
                raise ValueError(f"No code artifacts found for run {run_id}")
                
            elif len(code_artifacts) > 1:
                print(f"Multiple code artifacts found for run {run_id}, taking first.")
            code = code_artifacts[0]
            
            # download to temporary directory
            code_dir = code.download(root=os.path.join(tmp_dir, run_id))
            code_dirs.append(code_dir)

        subprocess.call(
            ["diff", "-r", code_dirs[0], code_dirs[1]]
        )

But it would be great to visualize the code the in interface

@kptkin kptkin added the a:app Area: Frontend/Backend label Apr 23, 2024
Copy link

Jason Davenport commented:
Hi seyuboglu,** **

Thank you for reaching out and our apologies on the delayed response.

Let me look into this deeper and see if I can reproduce it on my end. If this ends up being a bug I will let you know once it has been reported and any additional steps if needed.

Looking forward to working with you and I hope you are having a great start to the week!

Best,
Jason

Copy link

Jason Davenport commented:
Hi seyuboglu,** **

Wanted to give you a quick update. It looks like this is a known issue that engineering is actively working on. We will reach out if there is any more information we need; otherwise, keep an eye out as we will let you know when the issue has been resolved!

Hope you have a great rest of the week!

Best,
Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:app Area: Frontend/Backend
Projects
None yet
Development

No branches or pull requests

2 participants