The error is raised, if an intermediate activation’s spatial size is too small for a particular conv layer, so you would either have to increase the spatial size of the input, or reduce the pooling in the model.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier