question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`wandb.save` doesn't upload empty files to `wandb` server

See original GitHub issue

Aswandb.save doesn’t uplopad the empty files to the wandb remote, I’d suggest you to add a warning message in case the file is empty so as to let the user know that the file won’t be uploaded.

https://github.com/wandb/client/blob/a339333b3ee93864daf416f04c1501186dffac5c/wandb/sdk/wandb_run.py#L1353-L1443

To calculate the file size if it exists you can just os.path.getsize(path) as described in https://docs.python.org/3/library/os.path.html#os.path.getsize, which raises an OSError in case the file doesn’t exist or is unaccesible, and the size in bytes if it succeeds, so something like:

...
if os.path.getsize(glob_str) == 0:
    warnings.warn(f"File {glob_str} is empty and won't be uploaded")
    return
...

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ramit-wandbcommented, Jul 18, 2022

Sure! We happily accept PRs, it would be awesome if you could submit a PR. One of our enigneers could review it.

0reactions
exalate-issue-sync[bot]commented, Jul 20, 2022

WandB Internal User commented: ramit-wandb commented: Sure! We happily accept PRs, it would be awesome if you could submit a PR. One of our enigneers could review it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Save & Restore Files - Documentation - Weights & Biases
Saving Files · 1. Use wandb.save(filename) . · 2. Put a file in the wandb run directory, and it will get uploaded at...
Read more >
Launch Experiments with wandb.init - Documentation
This error indicates that the library is having difficulty launching the process which synchronizes data to the server. The following workarounds can help ......
Read more >
No config file and system plots for offline runs - W&B Help
When uploading offline runs, there is no config shown in the dashboard. Additionally, there are also no system plots.
Read more >
Troubleshooting - Documentation - Weights & Biases - Wandb
This is likely a connection problem — if your server loses internet access and ... Calling wandb.log writes a line to a local...
Read more >
Agent bug? File not found error - W&B Help - WandB community
The error you are getting 'No such file or directory' is appearing because Run 9uvr1lj3 is not available. The only sweep available in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found