Skip to content

Commit

Permalink
fix warning (apache#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
roywei authored Jul 31, 2019
1 parent 2b2f85d commit 5436b62
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/python/unittest/test_gluon_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,9 @@ def test_default_handlers():
metrics=train_acc,
trainer=trainer,
context=ctx)
# no handler
# no handler(all default handlers), no warning
with warnings.catch_warnings(record=True) as w:
est.fit(train_data=train_data, epochs=num_epochs)
assert 'You are training with the' in str(w[-1].message)

# handler with prepared loss and metrics
# use mix of default and user defined handlers
Expand All @@ -355,7 +354,7 @@ def test_default_handlers():
# handler with all user defined metrics
# use mix of default and user defined handlers
metric = MetricHandler(train_metrics=[train_acc])
logging = LoggingHandler(train_metrics=[train_acc], val_metrics=[mx.metric.RMSE("val acc")])
logging = LoggingHandler(train_metrics=[train_acc])
est.fit(train_data=train_data, epochs=num_epochs, event_handlers=[metric, logging])

# handler with mixed metrics, some handler use metrics prepared by estimator
Expand Down

0 comments on commit 5436b62

Please sign in to comment.