Like John, I think it highly unlikely the Thermocouple is at fault, however, it's quite possible it's indirectly part of the problem? The point is the thermocouple is only able to do it's job if you have the control knob in the correct position.
Try this, turn the knob towards the marked lighting position, before you get there press down fully and continue to turn, somewhere near the the mark you will feel the knob drop a little further into a slot, here it will lock and prevent further turning, this only place it will light and stay lit after several seconds for the thermocouple to warm and you let go of the knob.
In any other place, the thermocouple is not connected and although the pilot light may well light, the thermocouple cannot do it's job.