keras-io icon indicating copy to clipboard operation
keras-io copied to clipboard

mobileViT model dimension error

Open mhyeonsoo opened this issue 3 years ago • 0 comments
trafficstars

Hi, Thanks for the great sources. I've been trying implementing MobileViT, and facing the error.

So far, I got an error below.

ValueError: Exception encountered when calling layer "mobile_vi_t" (type MobileViT).
    
    in user code:
    
        File "/mount/workspace/02.Projects/02.General_AI/03.Classification/MobileVIT/modules/model.py", line 157, in call  *
            x = inverted_residual_block(
        File "/mount/workspace/02.Projects/02.General_AI/03.Classification/MobileVIT/modules/model.py", line 63, in inverted_residual_block  *
            return layers.Add()([m, x])
        File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
            raise e.with_traceback(filtered_tb) from None
        File "/usr/local/lib/python3.8/dist-packages/keras/layers/merge.py", line 78, in _compute_elemwise_op_output_shape
            raise ValueError(
    
        ValueError: Inputs have incompatible shapes. Received shapes (64, 64, 24) and (128, 128, 16)
    
    
    Call arguments received:
      • inputs=tf.Tensor(shape=(32, 256, 256, 3), dtype=float32)

Is there anything that I did wrong? Thanks,

mhyeonsoo avatar Sep 07 '22 00:09 mhyeonsoo