In this article, a composite film from polyimide and thermally exfoliated graphene was prepared through in situ polymerization, and the weight percent of thermally exfoliated graphene with respect to the polyimide monomers was 5 wt %. The film was carbonized at 1000 C for 1 h and then heat-treated at various temperatures up to 2100 C. For comparison, the corresponding pure polyimide film was also prepared and heat-treated at the same condition. It was found that the addition of graphene could effectively prevent the polyimide film from shrinking in the direction parallel to the film surface during the heat treatment. Furthermore, the results of density, X-ray diffraction, shrinkage in the direction perpendicular to the film surface and scanning electron microscopy revealed that the graphitization process of the polyimide could be accelerated by addition of graphene obviously. In view of the above phenomena, a reasonable explanation was presented.