wandb / wandb

🔥 A tool for visualizing and tracking your machine learning experiments. This repo contains the CLI and Python API.

Home Page:https://wandb.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[App]: No Selected Runs have Saved Code

seyuboglu opened this issue · comments

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:

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

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

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