How do I alter the code of EfficientNet V2 so it can take input images of unconventional size?

121 Views Asked by At

The source code for EfficientNetB0 V2 is available here - https://github.com/keras-team/keras/blob/v2.13.1/keras/applications/efficientnet_v2.py#L1115. How would I change the code so that it is compatible with an input images of size (12, 23, 1).

I understand that I must change the min_size variable on line 943 to 12, but I still get errors:

InvalidArgumentError: 4 root error(s) found.
  (0) INVALID_ARGUMENT:  required broadcastable shapes
     [[node replica_1/model_1/tf.math.multiply_1/Mul
 (defined at /home/bhullara/tf222/lib/python3.7/site-packages/keras/layers/core/tf_op_layer.py:261)
]]
     [[div_no_nan/_495]]
  (1) INVALID_ARGUMENT:  required broadcastable shapes
     [[node replica_1/model_1/tf.math.multiply_1/Mul
 (defined at /home/bhullara/tf222/lib/python3.7/site-packages/keras/layers/core/tf_op_layer.py:261)
]]
     [[div_no_nan/ReadVariableOp/_470]]
  (2) INVALID_ARGUMENT:  required broadcastable shapes
     [[node replica_1/model_1/tf.math.multiply_1/Mul
 (defined at /home/bhullara/tf222/lib/python3.7/site-packages/keras/layers/core/tf_op_layer.py:261)
]]
     [[Adam/Adam/group_deps/NoOp_2/_563]]
  (3) INVALID_ARGUMENT:  required broadcastable shapes
     [[node replica_1/model_1/tf.math.multiply_1/Mul
 (defined at /home/bhullara/tf222/lib/python3.7/site-packages/keras/layers/core/tf_op_layer.py:261)
]]
0

There are 0 best solutions below