Help with M1 error: Adaptive pool MPS: input sizes must be divisible by output sizes

Hello,

According to this comment by a PyTorch maintainer, adaptive average pooling with an MPS backend is not currently supported when the input size is not divisible by the output size, so the error you have encountered is to be expected. Furthermore, it appears that enabling CPU fallback via setting the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1, which is necessary to perform operations that are not yet implemented for MPS, does not resolve the problem, although you should give it a try yourself nonetheless. Therefore, I reckon your options would be I) Ensuring input dimensions are a factor of output dimensions whenever conducting adaptive pooling, but this is not a long-term solution, or II) Using Colab or Kaggle Notebooks. They provide free GPUs and TPUs up to a certain limit, and I’ve found both services to be generally more reliable than Paperspace.

2 Likes