fix(Reporting): raise exception if wandb is not available but with_wandb is True (#122)

This commit is contained in:
Mark Aron Szulyovszky
2022-01-07 15:32:18 +01:00
committed by GitHub
parent d0bf8e4cd5
commit c8211e90ff
+3 -3
View File
@@ -5,9 +5,9 @@ from utils.helpers import weighted_average
def launch_wandb(project_name:str, default_config:dict, sweep:bool=False):
from wandb_setup import get_wandb
wandb = get_wandb()
if wandb is None:
return None
if wandb is None:
raise Exception("Wandb can not be initalized, the environment variable WANDB_API_KEY is missing (can also use .env file)")
elif sweep:
wandb.init(project=project_name, config = default_config)
return wandb