Closed sailfish009 closed 4 years ago
Hi, below sample code give me error:
return match ( name, "WarmupMultiStepLR", WarmupMultiStepLR( \ optimizer, \ cfg.SOLVER.STEPS, \ cfg.SOLVER.GAMMA, \ warmup_factor=cfg.SOLVER.WARMUP_FACTOR, \ warmup_iters=cfg.SOLVER.WARMUP_ITERS, \ warmup_method=cfg.SOLVER.WARMUP_METHOD, \ ), "WarmupCosineLR", WarmupCosineLR( \ optimizer, \ cfg.SOLVER.MAX_ITER, \ warmup_factor=cfg.SOLVER.WARMUP_FACTOR, \ warmup_iters=cfg.SOLVER.WARMUP_ITERS, \ warmup_method=cfg.SOLVER.WARMUP_METHOD, \ ), _, raise ValueError("Unknown LR scheduler: {}".format(name)) )
_, raise ValueError("Unknown LR scheduler: {}".format(name)) ^ SyntaxError: invalid syntax
Maybe pampy needs a raise_error function to delegate error raising.
raise_error
from pampy import match, _, raise_error return match(x, 1, "foo", 2, "bar", _, raise_error(ValueError, "Message") )
Hi, below sample code give me error: