Sometimes you've got to be in the middle ring and hit the climb super smooth. The granny ring lets you power on and off too much, the middle ring will smooth it out a bit more meaning you can find the sweetspot between leaning forwards and wheelspinning a bit easier.
Also, getting knackered and transitioning to standing will surely add to the wheelspins, so when youve got your position try to stick to it for the duration of the climb.