Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
0b59ecde
"tests/vscode:/vscode.git/clone" did not exist on "5a70a77bfa07e8761b195f4239297bf22fa40ad8"
Unverified
Commit
0b59ecde
authored
Oct 24, 2022
by
regisss
Committed by
GitHub
Oct 24, 2022
Browse files
Display the number of trainable parameters when lauching a training (#19835)
parent
536f3384
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/trainer.py
src/transformers/trainer.py
+3
-0
No files found.
src/transformers/trainer.py
View file @
0b59ecde
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment