there is a misconception about yawning: it doesnt mean you are sleepy.
yawning means you arent getting enough oxygen. normally, when one gets very tired, one starts taking very shallow breaths. the energy required to stay awake requires more oxygen than youre taking in, and thus you yawn.
its likely you dont breathe enough. you cant get enough oxygen when youre working out, no matter what youre doing. if youre lifting weights, you need to feed deep tissues like ligaments, cartilage, connective tissue, deep muscle fibers, with as much oxygen as possible. failure to do so will lessen your growth both short and long term. if youre doing cardio, you need extra oxygen for all of your processes to me moving at such an accelerated rate, and to feed the muscles doing the work.
most westerners are dangerously underinformed on the importance of deep breathing, even when not exercising. the lungs are not a simple organ, when one breathes too shallow one only fills the center part of the lung. a deep, relaxed breath fills the center first, then fills the bottom parts of the lungs. consistently not breathing enough to fill the bottoms allows buildup of particles in the lungs, which leads to a host of problems. after the bottom is filled, the top parts near the collar bones fill as well. once these 3 sections of the lungs are filled with oxygen, the body's metabolism changes somewhat, cells are able to perform their tasks at maximum capacity, and deep recesses of the body that are often close to anoxic, like vital organs or joint areas, are able to function more fluidly and precisely. the muscles and other fleshy tissues receive their fullest portions of energy and nourishment. lack of oxygen, especially on a consistent basis, promotes cellular death (and cancer), poor immune system, slow metabolism, etc. when youre resting in the gym, make sure you feel all 3 areas of the lungs fill up in a relaxed manner. when youre running, take youre breath in deep enough, and when youre weightlifting, take some very deep breaths before you begin a set and dont ever hold youre breath while bearing any kind of load - always be either inhaling or exhaling.
(when i was bodybuilding, i was always cycling air out fast and hard on positive motion and slow and deep on the negative)
google search "deep breathing" and "deep breathing exercises" and "active meditation" for more info. give a few searches for "shallow breathing health effects" or stuff of that nature. nothing in life is more important than breathing well, as breath is the source of all wellness.
i couldnt possibly ever yawn when i train for martial arts. im always cycling such huge, deep breaths, that it could be 6am and i just woke up or 2am and ive been up for 20 hours and my body simply wouldnt be able to yawn while i am breathing so actively. same for weightlifting in a gym, if i yawned, id immediately realize im fucking my body up. sitting down on a couch is a different story.