MNE-Python offers the choice of three algorithms to compute spectrograms: Morlet wavelets, multitaper, and Stockwell transform. These are the three functions corresponding to the three algorithms:
These three functions take very similar parameters. Because you want to compute spectrograms for individual epochs, specify average=False when calling one of the above functions. This will cause them to return an EpochsTFR object. Take a look at the .data field of that object, I think that is the data you want to give to your CNN model.