I don’t know what might be causing the issue, as I’m not able to reproduce the NaN outputs using your code and random inputs:
model = models.vgg16(pretrained=True)
model.classifier.add_module('7', nn.Linear(in_features=1000, out_features=500,bias=True))
model.classifier.add_module('8', nn.ReLU())
model.classifier.add_module('9', nn.Linear(in_features=500, out_features=100,bias=True))
model.classifier.add_module('10', nn.ReLU())
model.classifier.add_module('11', nn.Linear(in_features=100, out_features=67,bias=True))

for _ in range(100):
    x = torch.randn(1, 3, 224, 224)
    out = model(x)
    print(torch.isnan(out).any())