catch TypeError when a not generated .pt file occurs in a directory