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
bb154ac5
Unverified
Commit
bb154ac5
authored
Jun 17, 2020
by
Saurabh Misra
Committed by
GitHub
Jun 17, 2020
Browse files
Fixing TPU training by disabling wandb.watch gradients logging for TPU (#4926)
parent
fb6cccb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/trainer.py
src/transformers/trainer.py
+2
-2
No files found.
src/transformers/trainer.py
View file @
bb154ac5
...
@@ -335,8 +335,8 @@ class Trainer:
...
@@ -335,8 +335,8 @@ class Trainer:
'Automatic Weights & Biases logging enabled, to disable set os.environ["WANDB_DISABLED"] = "true"'
'Automatic Weights & Biases logging enabled, to disable set os.environ["WANDB_DISABLED"] = "true"'
)
)
wandb
.
init
(
project
=
os
.
getenv
(
"WANDB_PROJECT"
,
"huggingface"
),
config
=
vars
(
self
.
args
))
wandb
.
init
(
project
=
os
.
getenv
(
"WANDB_PROJECT"
,
"huggingface"
),
config
=
vars
(
self
.
args
))
# keep track of model topology and gradients
# keep track of model topology and gradients
, unsupported on TPU
if
os
.
getenv
(
"WANDB_WATCH"
)
!=
"false"
:
if
not
is_torch_tpu_available
()
and
os
.
getenv
(
"WANDB_WATCH"
)
!=
"false"
:
wandb
.
watch
(
wandb
.
watch
(
self
.
model
,
log
=
os
.
getenv
(
"WANDB_WATCH"
,
"gradients"
),
log_freq
=
max
(
100
,
self
.
args
.
logging_steps
)
self
.
model
,
log
=
os
.
getenv
(
"WANDB_WATCH"
,
"gradients"
),
log_freq
=
max
(
100
,
self
.
args
.
logging_steps
)
)
)
...
...
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