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
a34a571d
Commit
a34a571d
authored
Aug 30, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 393926742
parent
5e5cdec3
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
33 deletions
+33
-33
official/vision/beta/modeling/maskrcnn_model_test.py
official/vision/beta/modeling/maskrcnn_model_test.py
+1
-1
official/vision/beta/projects/panoptic_maskrcnn/modeling/panoptic_maskrcnn_model_test.py
...anoptic_maskrcnn/modeling/panoptic_maskrcnn_model_test.py
+1
-1
official/vision/beta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
...eta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
+5
-5
official/vision/beta/projects/simclr/tasks/simclr.py
official/vision/beta/projects/simclr/tasks/simclr.py
+7
-7
official/vision/beta/projects/video_ssl/tasks/linear_eval.py
official/vision/beta/projects/video_ssl/tasks/linear_eval.py
+1
-1
official/vision/beta/projects/volumetric_models/tasks/semantic_segmentation_3d.py
...jects/volumetric_models/tasks/semantic_segmentation_3d.py
+3
-3
official/vision/beta/tasks/image_classification.py
official/vision/beta/tasks/image_classification.py
+3
-3
official/vision/beta/tasks/maskrcnn.py
official/vision/beta/tasks/maskrcnn.py
+3
-3
official/vision/beta/tasks/retinanet.py
official/vision/beta/tasks/retinanet.py
+3
-3
official/vision/beta/tasks/semantic_segmentation.py
official/vision/beta/tasks/semantic_segmentation.py
+3
-3
official/vision/beta/tasks/video_classification.py
official/vision/beta/tasks/video_classification.py
+3
-3
No files found.
official/vision/beta/modeling/maskrcnn_model_test.py
View file @
a34a571d
...
@@ -384,7 +384,7 @@ class MaskRCNNModelTest(parameterized.TestCase, tf.test.TestCase):
...
@@ -384,7 +384,7 @@ class MaskRCNNModelTest(parameterized.TestCase, tf.test.TestCase):
ckpt
.
save
(
os
.
path
.
join
(
save_dir
,
'ckpt'
))
ckpt
.
save
(
os
.
path
.
join
(
save_dir
,
'ckpt'
))
partial_ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
backbone
)
partial_ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
backbone
)
partial_ckpt
.
re
store
(
tf
.
train
.
latest_checkpoint
(
partial_ckpt
.
re
ad
(
tf
.
train
.
latest_checkpoint
(
save_dir
)).
expect_partial
().
assert_existing_objects_matched
()
save_dir
)).
expect_partial
().
assert_existing_objects_matched
()
if
include_mask
:
if
include_mask
:
...
...
official/vision/beta/projects/panoptic_maskrcnn/modeling/panoptic_maskrcnn_model_test.py
View file @
a34a571d
...
@@ -460,7 +460,7 @@ class PanopticMaskRCNNModelTest(parameterized.TestCase, tf.test.TestCase):
...
@@ -460,7 +460,7 @@ class PanopticMaskRCNNModelTest(parameterized.TestCase, tf.test.TestCase):
ckpt
.
save
(
os
.
path
.
join
(
save_dir
,
'ckpt'
))
ckpt
.
save
(
os
.
path
.
join
(
save_dir
,
'ckpt'
))
partial_ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
backbone
)
partial_ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
backbone
)
partial_ckpt
.
re
store
(
tf
.
train
.
latest_checkpoint
(
partial_ckpt
.
re
ad
(
tf
.
train
.
latest_checkpoint
(
save_dir
)).
expect_partial
().
assert_existing_objects_matched
()
save_dir
)).
expect_partial
().
assert_existing_objects_matched
()
partial_ckpt_mask
=
tf
.
train
.
Checkpoint
(
partial_ckpt_mask
=
tf
.
train
.
Checkpoint
(
...
...
official/vision/beta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
View file @
a34a571d
...
@@ -77,14 +77,14 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
...
@@ -77,14 +77,14 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
checkpoint_path
=
_get_checkpoint_path
(
checkpoint_path
=
_get_checkpoint_path
(
self
.
task_config
.
init_checkpoint
)
self
.
task_config
.
init_checkpoint
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
checkpoint_path
)
status
=
ckpt
.
re
ad
(
checkpoint_path
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
init_module
==
'backbone'
:
elif
init_module
==
'backbone'
:
checkpoint_path
=
_get_checkpoint_path
(
checkpoint_path
=
_get_checkpoint_path
(
self
.
task_config
.
init_checkpoint
)
self
.
task_config
.
init_checkpoint
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
checkpoint_path
)
status
=
ckpt
.
re
ad
(
checkpoint_path
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
elif
init_module
==
'segmentation_backbone'
:
elif
init_module
==
'segmentation_backbone'
:
...
@@ -92,7 +92,7 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
...
@@ -92,7 +92,7 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
self
.
task_config
.
segmentation_init_checkpoint
)
self
.
task_config
.
segmentation_init_checkpoint
)
ckpt
=
tf
.
train
.
Checkpoint
(
ckpt
=
tf
.
train
.
Checkpoint
(
segmentation_backbone
=
model
.
segmentation_backbone
)
segmentation_backbone
=
model
.
segmentation_backbone
)
status
=
ckpt
.
re
store
(
checkpoint_path
)
status
=
ckpt
.
re
ad
(
checkpoint_path
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
elif
init_module
==
'segmentation_decoder'
:
elif
init_module
==
'segmentation_decoder'
:
...
@@ -100,7 +100,7 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
...
@@ -100,7 +100,7 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
self
.
task_config
.
segmentation_init_checkpoint
)
self
.
task_config
.
segmentation_init_checkpoint
)
ckpt
=
tf
.
train
.
Checkpoint
(
ckpt
=
tf
.
train
.
Checkpoint
(
segmentation_decoder
=
model
.
segmentation_decoder
)
segmentation_decoder
=
model
.
segmentation_decoder
)
status
=
ckpt
.
re
store
(
checkpoint_path
)
status
=
ckpt
.
re
ad
(
checkpoint_path
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
...
...
official/vision/beta/projects/simclr/tasks/simclr.py
View file @
a34a571d
...
@@ -150,11 +150,11 @@ class SimCLRPretrainTask(base_task.Task):
...
@@ -150,11 +150,11 @@ class SimCLRPretrainTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
assert
"Only 'all' or 'backbone' can be used to initialize the model."
assert
"Only 'all' or 'backbone' can be used to initialize the model."
...
@@ -455,16 +455,16 @@ class SimCLRFinetuneTask(base_task.Task):
...
@@ -455,16 +455,16 @@ class SimCLRFinetuneTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone_projection'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone_projection'
:
ckpt
=
tf
.
train
.
Checkpoint
(
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
,
projection_head
=
model
.
projection_head
)
backbone
=
model
.
backbone
,
projection_head
=
model
.
projection_head
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
assert
"Only 'all' or 'backbone' can be used to initialize the model."
assert
"Only 'all' or 'backbone' can be used to initialize the model."
...
...
official/vision/beta/projects/video_ssl/tasks/linear_eval.py
View file @
a34a571d
...
@@ -41,7 +41,7 @@ class VideoSSLEvalTask(video_classification.VideoClassificationTask):
...
@@ -41,7 +41,7 @@ class VideoSSLEvalTask(video_classification.VideoClassificationTask):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
.
re
store
(
ckpt_dir_or_file
)
ckpt
.
re
ad
(
ckpt_dir_or_file
)
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
...
...
official/vision/beta/projects/volumetric_models/tasks/semantic_segmentation_3d.py
View file @
a34a571d
...
@@ -79,8 +79,8 @@ class SemanticSegmentation3DTask(base_task.Task):
...
@@ -79,8 +79,8 @@ class SemanticSegmentation3DTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
'all'
in
self
.
task_config
.
init_checkpoint_modules
:
if
'all'
in
self
.
task_config
.
init_checkpoint_modules
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
else
:
else
:
ckpt_items
=
{}
ckpt_items
=
{}
if
'backbone'
in
self
.
task_config
.
init_checkpoint_modules
:
if
'backbone'
in
self
.
task_config
.
init_checkpoint_modules
:
...
@@ -89,7 +89,7 @@ class SemanticSegmentation3DTask(base_task.Task):
...
@@ -89,7 +89,7 @@ class SemanticSegmentation3DTask(base_task.Task):
ckpt_items
.
update
(
decoder
=
model
.
decoder
)
ckpt_items
.
update
(
decoder
=
model
.
decoder
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
ckpt_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
ckpt_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
logging
.
info
(
'Finished loading pretrained checkpoint from %s'
,
logging
.
info
(
'Finished loading pretrained checkpoint from %s'
,
...
...
official/vision/beta/tasks/image_classification.py
View file @
a34a571d
...
@@ -62,11 +62,11 @@ class ImageClassificationTask(base_task.Task):
...
@@ -62,11 +62,11 @@ class ImageClassificationTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
official/vision/beta/tasks/maskrcnn.py
View file @
a34a571d
...
@@ -96,11 +96,11 @@ class MaskRCNNTask(base_task.Task):
...
@@ -96,11 +96,11 @@ class MaskRCNNTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
official/vision/beta/tasks/retinanet.py
View file @
a34a571d
...
@@ -71,11 +71,11 @@ class RetinaNetTask(base_task.Task):
...
@@ -71,11 +71,11 @@ class RetinaNetTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
official/vision/beta/tasks/semantic_segmentation.py
View file @
a34a571d
...
@@ -63,8 +63,8 @@ class SemanticSegmentationTask(base_task.Task):
...
@@ -63,8 +63,8 @@ class SemanticSegmentationTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
'all'
in
self
.
task_config
.
init_checkpoint_modules
:
if
'all'
in
self
.
task_config
.
init_checkpoint_modules
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
else
:
else
:
ckpt_items
=
{}
ckpt_items
=
{}
if
'backbone'
in
self
.
task_config
.
init_checkpoint_modules
:
if
'backbone'
in
self
.
task_config
.
init_checkpoint_modules
:
...
@@ -73,7 +73,7 @@ class SemanticSegmentationTask(base_task.Task):
...
@@ -73,7 +73,7 @@ class SemanticSegmentationTask(base_task.Task):
ckpt_items
.
update
(
decoder
=
model
.
decoder
)
ckpt_items
.
update
(
decoder
=
model
.
decoder
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
ckpt_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
ckpt_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
logging
.
info
(
'Finished loading pretrained checkpoint from %s'
,
logging
.
info
(
'Finished loading pretrained checkpoint from %s'
,
...
...
official/vision/beta/tasks/video_classification.py
View file @
a34a571d
...
@@ -86,11 +86,11 @@ class VideoClassificationTask(base_task.Task):
...
@@ -86,11 +86,11 @@ class VideoClassificationTask(base_task.Task):
# Restoring checkpoint.
# Restoring checkpoint.
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
if
self
.
task_config
.
init_checkpoint_modules
==
'all'
:
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
ckpt
=
tf
.
train
.
Checkpoint
(
**
model
.
checkpoint_items
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
assert_consum
ed
()
status
.
expect_partial
().
assert_existing_objects_match
ed
()
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
elif
self
.
task_config
.
init_checkpoint_modules
==
'backbone'
:
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
ckpt
=
tf
.
train
.
Checkpoint
(
backbone
=
model
.
backbone
)
status
=
ckpt
.
re
store
(
ckpt_dir_or_file
)
status
=
ckpt
.
re
ad
(
ckpt_dir_or_file
)
status
.
expect_partial
().
assert_existing_objects_matched
()
status
.
expect_partial
().
assert_existing_objects_matched
()
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
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