These are all different errors.
The out of memory issue is raised, if your GPU doesn’t have enough memory and you would have to reduce e.g. the batch size.
The second error is raised if you are passing an input tensor to the model, which is too small and a layer would create an empty output tensor (a pooling layer in your case).
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.