0

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)
]]
PiccolMan
  • 4,854
  • 12
  • 35
  • 53
  • No, the architecture has a minimum size, you cannot simply use this architecture with that image size. It is too small. – Dr. Snoopy Jul 12 '23 at 18:47
  • Surely, I can make the architecture smaller. For example, by changing the `num_repeats` or `strides` variables in the `DEFAULT_BLOCKS_ARGS` dictionary. Unfortunately, I still get the above error after making those changes. I'm hoping someone can identify the cause of the error. – PiccolMan Jul 12 '23 at 23:15
  • If you modified the code, then always provide the new code in the question. – Dr. Snoopy Jul 13 '23 at 04:04

0 Answers0