Display the number of trainable parameters when lauching a training (#19835)

This commit is contained in:
regisss 2022-10-24 15:15:52 +02:00 committed by GitHub
parent 536f338441
commit 0b59ecdefd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1611,6 +1611,9 @@ class Trainer:
logger.info(f" Total train batch size (w. parallel, distributed & accumulation) = {total_train_batch_size}")
logger.info(f" Gradient Accumulation steps = {args.gradient_accumulation_steps}")
logger.info(f" Total optimization steps = {max_steps}")
logger.info(
f" Number of trainable parameters = {sum(p.numel() for p in model.parameters() if p.requires_grad)}"
)
self.state.epoch = 0
start_time = time.time()