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
ModelZoo
ResNet50_tensorflow
Commits
5ad1d93f
Commit
5ad1d93f
authored
Feb 25, 2022
by
Zihan Wang
Browse files
fix bug
parent
fd1528b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
official/projects/longformer/sentence_prediction_with_checkpoint_convert.py
...longformer/sentence_prediction_with_checkpoint_convert.py
+4
-5
No files found.
official/projects/longformer/sentence_prediction_with_checkpoint_convert.py
View file @
5ad1d93f
...
...
@@ -227,11 +227,10 @@ class SentencePredictionTask(base_task.Task):
"""Load a pretrained checkpoint (if exists) and then train from iter 0."""
ckpt_dir_or_file
=
self
.
task_config
.
init_checkpoint
if
self
.
task_config
.
initial_parameters_from_pk
:
num_layers
=
self
.
task_config
.
model
.
encoder
.
num_layers
num_attention_heads
=
self
.
task_config
.
model
.
encoder
.
num_attention_heads
hidden_size
=
self
.
task_config
.
model
.
encoder
.
hidden_size
inner_dim
=
self
.
task_config
.
model
.
encoder
.
inner_dim
head_size
=
hidden_size
/
num_attention_heads
num_layers
=
self
.
task_config
.
model
.
encoder
.
any
.
num_layers
num_attention_heads
=
self
.
task_config
.
model
.
encoder
.
any
.
num_attention_heads
hidden_size
=
self
.
task_config
.
model
.
encoder
.
any
.
hidden_size
head_size
=
hidden_size
//
num_attention_heads
assert
head_size
*
num_attention_heads
==
hidden_size
encoder
=
model
.
checkpoint_items
[
'encoder'
]
...
...
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