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
5406f31a
Unverified
Commit
5406f31a
authored
Nov 02, 2020
by
Sylvain Gugger
Committed by
GitHub
Nov 02, 2020
Browse files
Fix TensorBoardCallback for older versions of PyTorch (#8239)
parent
d1ad4bff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/integrations.py
src/transformers/integrations.py
+3
-1
No files found.
src/transformers/integrations.py
View file @
5406f31a
...
...
@@ -282,7 +282,9 @@ class TensorBoardCallback(TrainerCallback):
if
hasattr
(
model
,
"config"
)
and
model
.
config
is
not
None
:
model_config_json
=
model
.
config
.
to_json_string
()
self
.
tb_writer
.
add_text
(
"model_config"
,
model_config_json
)
self
.
tb_writer
.
add_hparams
(
args
.
to_sanitized_dict
(),
metric_dict
=
{})
# Version of TensorBoard coming from tensorboardX does not have this method.
if
hasattr
(
self
.
tb_writer
,
"add_hparams"
):
self
.
tb_writer
.
add_hparams
(
args
.
to_sanitized_dict
(),
metric_dict
=
{})
def
on_log
(
self
,
args
,
state
,
control
,
logs
=
None
,
**
kwargs
):
if
state
.
is_world_process_zero
:
...
...
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