Note that the error message changed, which could point to inputs with different shapes. While the initial error showed an activation shape of [128, 512] it’s now showing [1, 2048], so you might want to check the input shapes to the model and make sure to use constant ones or use an adaptive pooling layer to create a defined activation shape.