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
9f81f1cb
"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "941d1501c118928df3ed9161f0737a119082b755"
Commit
9f81f1cb
authored
Oct 07, 2019
by
VictorSanh
Browse files
fix convert pt_to_tf2 for custom weights
parent
1615360c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
transformers/convert_pytorch_checkpoint_to_tf2.py
transformers/convert_pytorch_checkpoint_to_tf2.py
+6
-4
No files found.
transformers/convert_pytorch_checkpoint_to_tf2.py
View file @
9f81f1cb
...
...
@@ -173,10 +173,12 @@ def convert_all_pt_checkpoints_to_tf(args_model_type, tf_dump_path, model_shortc
else
:
model_file
=
cached_path
(
model_shortcut_name
,
force_download
=
not
use_cached_models
)
convert_pt_checkpoint_to_tf
(
model_type
,
model_file
,
config_file
,
os
.
path
.
join
(
tf_dump_path
,
model_shortcut_name
+
'-tf_model.h5'
),
if
os
.
path
.
isfile
(
model_shortcut_name
):
model_shortcut_name
=
'converted_model'
convert_pt_checkpoint_to_tf
(
model_type
=
model_type
,
pytorch_checkpoint_path
=
model_file
,
config_file
=
config_file
,
tf_dump_path
=
os
.
path
.
join
(
tf_dump_path
,
model_shortcut_name
+
'-tf_model.h5'
),
compare_with_pt_model
=
compare_with_pt_model
)
os
.
remove
(
config_file
)
os
.
remove
(
model_file
)
...
...
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