Magnetic torpedoes were notorious for premature detonations in heavy seas. This is to be expected! Contact pistols may not help, as you'll presumably be setting them to run shallower, thus putting them closer to those wave swells. Not only will you still run into premature detonations, but a torpedo broaching the surface is a perfect recipe for a circular runner.
If conditions aren't right, don't put yourself and your boat in jeopardy by carrying out a less than perfect attack.