A version of the Donaldson-Thomas invariants of a Calabi-Yau threefold is proposed as a conjectural mathematical definition of
the Gopakumar-Vafa invariants. These invariants have a local version, which is verified to satisfy the required properties for contractible
curves. This provides a new viewpoint on the computation of the local Gromov-Witten invariants of contractible curves by Bryan, Leung, and the author.