added cpu + amp error
This commit is contained in:
parent
a5756d91be
commit
9be15aa29f
|
@ -21,6 +21,27 @@ np.random.seed(SEED)
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
# TESTS
|
# TESTS
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
|
def test_early_stopping_cpu_model():
|
||||||
|
"""
|
||||||
|
Test each of the trainer options
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
|
||||||
|
stopping = EarlyStopping()
|
||||||
|
trainer_options = dict(
|
||||||
|
early_stop_callback=stopping,
|
||||||
|
gradient_clip=1.0,
|
||||||
|
overfit_pct=0.20,
|
||||||
|
track_grad_norm=2,
|
||||||
|
print_nan_grads=True,
|
||||||
|
progress_bar=False,
|
||||||
|
experiment=get_exp(),
|
||||||
|
train_percent_check=0.1,
|
||||||
|
val_percent_check=0.1
|
||||||
|
)
|
||||||
|
|
||||||
|
model, hparams = get_model()
|
||||||
|
run_gpu_model_test(trainer_options, model, hparams, on_gpu=False)
|
||||||
|
|
||||||
|
|
||||||
def test_cpu_model_with_amp():
|
def test_cpu_model_with_amp():
|
||||||
|
@ -156,30 +177,6 @@ def test_all_features_cpu_model():
|
||||||
run_gpu_model_test(trainer_options, model, hparams, on_gpu=False)
|
run_gpu_model_test(trainer_options, model, hparams, on_gpu=False)
|
||||||
|
|
||||||
|
|
||||||
def test_early_stopping_cpu_model():
|
|
||||||
"""
|
|
||||||
Test each of the trainer options
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
|
|
||||||
stopping = EarlyStopping()
|
|
||||||
trainer_options = dict(
|
|
||||||
early_stop_callback=stopping,
|
|
||||||
gradient_clip=1.0,
|
|
||||||
overfit_pct=0.20,
|
|
||||||
track_grad_norm=2,
|
|
||||||
print_nan_grads=True,
|
|
||||||
progress_bar=False,
|
|
||||||
experiment=get_exp(),
|
|
||||||
max_nb_epochs=1,
|
|
||||||
train_percent_check=0.4,
|
|
||||||
val_percent_check=0.4
|
|
||||||
)
|
|
||||||
|
|
||||||
model, hparams = get_model()
|
|
||||||
run_gpu_model_test(trainer_options, model, hparams, on_gpu=False)
|
|
||||||
|
|
||||||
|
|
||||||
def test_single_gpu_model():
|
def test_single_gpu_model():
|
||||||
"""
|
"""
|
||||||
Make sure single GPU works (DP mode)
|
Make sure single GPU works (DP mode)
|
||||||
|
|
Loading…
Reference in New Issue