{"id":28452,"library":"wandb-osh","title":"wandb-osh","description":"Trigger W&B offline syncs from compute nodes without internet access. Current version: 1.2.3. Release cadence is irregular, with bug fixes and minor enhancements.","status":"active","version":"1.2.3","language":"python","source_language":"en","source_url":"https://github.com/klieret/wandb-offline-sync-hook","tags":["wandb","offline","sync","mlops","lightning"],"install":[{"cmd":"pip install wandb-osh","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for W&B integration","package":"wandb","optional":false},{"reason":"Optional integration for PyTorch Lightning","package":"lightning","optional":true}],"imports":[{"note":"wandb_osh is a module, not a class; the main class is wandb_osh.WandbOSH","wrong":"from wandb_osh import WandbOSH","symbol":"wandb_osh","correct":"import wandb_osh"},{"note":"The hook is re-exported from the top-level module since v1.0.0","wrong":"from wandb_osh.hooks import TriggerWandbSyncHook","symbol":"TriggerWandbSyncHook","correct":"from wandb_osh import TriggerWandbSyncHook"},{"note":"Accepts a string, not a logging level constant; added in v1.2.0","wrong":"wandb_osh.set_log_level(logging.INFO)","symbol":"wandb_osh.set_log_level","correct":"wandb_osh.set_log_level('INFO')"}],"quickstart":{"code":"import wandb_osh\nimport wandb\n\n# Initialize W&B in offline mode\nwandb.init(mode=\"offline\", project=\"my_project\")\n\n# Create the sync trigger\ntrigger = wandb_osh.TriggerWandbSyncHook()\n\n# Example: trigger sync after each run (e.g., at end of script)\n# Note: In practice, the trigger runs in a background thread/process.\n# For a full example, see the GitHub README.\nprint(\"Run completed. Sync will be triggered automatically.\")\n","lang":"python","description":"Minimal setup for offline W&B logging with automatic sync trigger."},"warnings":[{"fix":"Call wandb.init(mode='offline', ...) before using the hook.","message":"wandb_osh.TriggerWandbSyncHook requires W&B to be initialized in offline mode. If mode is not set to 'offline', the hook may not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Install wandb-osh with 'lightning' extra: pip install wandb-osh[lightning]","message":"The optional dependency 'pytorch-lightning' was replaced by 'lightning' (the new unified package) in v1.2.2. Installing 'pytorch-lightning' is deprecated.","severity":"deprecated","affected_versions":">=1.2.2"},{"fix":"Wrap trigger instantiation with a rank check: if dist.get_rank() == 0: trigger = TriggerWandbSyncHook()","message":"In distributed training (e.g., DDP), the sync hook may trigger on every process, causing duplicate syncs. This was partially fixed in v1.2.3, but ensure only rank 0 triggers sync.","severity":"gotcha","affected_versions":"<=1.2.2"},{"fix":"Use Python 3.8 or higher.","message":"Python 3.7 support was dropped in v1.1.0.","severity":"breaking","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install using: pip install wandb-osh","cause":"Library not installed or wrong import path.","error":"ModuleNotFoundError: No module named 'wandb_osh'"},{"fix":"Update to latest version: pip install --upgrade wandb-osh, then use: from wandb_osh import TriggerWandbSyncHook","cause":"Outdated version (<1.0.0) or trying to import from wrong submodule.","error":"AttributeError: module 'wandb_osh' has no attribute 'TriggerWandbSyncHook'"},{"fix":"Call wandb.init(mode='offline', ...) before creating the trigger.","cause":"W&B initialized without mode='offline'.","error":"wandb.errors.error.UsageError: Mode must be 'offline' to use TriggerWandbSyncHook"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}