Skip to content

Commit

Permalink
Workaround end2end test failure by using random bias
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed Apr 6, 2022
1 parent 114a945 commit 2e5921c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions larq_compute_engine/tests/end2end_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def dummy(x):
use_bias=False,
activation=activation,
)(x)
x = tf.keras.layers.BatchNormalization(momentum=0.7)(x)
x = tf.keras.layers.BatchNormalization(
momentum=0.7, beta_initializer="random_normal"
)(x)
return tf.keras.layers.add([x, shortcut])

return dummy
Expand Down Expand Up @@ -235,10 +237,8 @@ def test_simple_model(dataset, conversion_function, model_cls):
def test_int8_input_output(
conversion_function, model_cls, inference_input_type, inference_output_type
):
if conversion_function == convert_keras_model_as_saved_model and (
model_cls == toy_model or version.parse(tf.__version__) < version.parse("2.2")
):
pytest.skip("convert_keras_model_as_saved_model currently fails in this case.")
if version.parse(tf.__version__) < version.parse("2.2"):
pytest.skip("TensorFlow 2.2 or newer is required for saved model conversion.")

model_lce = conversion_function(
model_cls(),
Expand Down

0 comments on commit 2e5921c

Please sign in to comment.