What is the meaning of the '2' on some Compressed Gas Hazard signs in the lab?
The 2 refers to DOT (Department of Transportation) hazard class 2. This reference describes the different DOT hazard classes. 

As summarized in the comments:


  Class 2 (compressed gas) is divided into three subclasses (2.1 - flammable, 2.2 - non-flammable, non-toxic and 2.3 - toxic). I imagine the diamonds for Class 2 don't contain the subclass number because there is a different diamond colour/symbology for each subclass (as opposed to for instance 5.1 (oxidising agent) and 5.2 (organic peroxide), which have the same symbol and colours).