Warn if call wandb.save and didn't pass in a str
@@ -342,7 +342,8 @@ def _jupyter_login(force=True, api=None):
termerror("Not authenticated. Copy a key from https://app.wandb.ai/authorize")
key = getpass.getpass("API Key: ").strip()
except NotImplementedError:
- termerror("Can't accept input in this environment, you should set WANDB_API_KEY or call wandb.login(key='YOUR_API_KEY')")
+ termerror(
+ "Can't accept input in this environment, you should set WANDB_API_KEY or call wandb.login(key='YOUR_API_KEY')")
return key, anonymous
api = api or (run.api if run else None)
@@ -477,6 +478,9 @@ def save(glob_str, base_path=None, policy="live"):
if policy not in ("live", "end"):
raise ValueError(
'Only "live" and "end" policies are currently supported.')
+ if not isinstance(glob_str, str):
+ raise ValueError("Must call wandb.save(glob_str) with glob_str a str")
+
if base_path is None:
base_path = os.path.dirname(glob_str)
if isinstance(glob_str, bytes):
@@ -1022,6 +1026,7 @@ def _wandb_finished(run):
shutdown_async_log_thread()
run.close_files()
+
tensorflow = util.LazyLoader('tensorflow', globals(), 'wandb.tensorflow')
tensorboard = util.LazyLoader('tensorboard', globals(), 'wandb.tensorboard')
jupyter = util.LazyLoader('jupyter', globals(), 'wandb.jupyter')
