Flat Yorkshire Pudding
I just realized that you said 'minutes after' before you said 'as soon as I take it out'.

If it's as soon as you take it out, it's a problem with it being undercooked.

If it takes a few minutes to deflate, it can be an issue with cooling them too quickly.  You can get around this problem by taking a sharp knife or skewer and poking a couple of holes in the top of each one.

This will allow any built up steam to escape (which will unfortunately cool it off), but it will prevent the trapped air from creating a vaccuum as it cools, causing it to collapse.