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
a56d7ab3
Unverified
Commit
a56d7ab3
authored
Apr 14, 2021
by
Leandro Schelb
Committed by
GitHub
Apr 14, 2021
Browse files
Fixed deprecated tf.flags (#9912)
parent
2b68aa95
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
10 deletions
+13
-10
research/attention_ocr/python/common_flags.py
research/attention_ocr/python/common_flags.py
+1
-1
research/attention_ocr/python/datasets/fsns_test.py
research/attention_ocr/python/datasets/fsns_test.py
+2
-1
research/attention_ocr/python/demo_inference.py
research/attention_ocr/python/demo_inference.py
+1
-1
research/attention_ocr/python/demo_inference_test.py
research/attention_ocr/python/demo_inference_test.py
+2
-1
research/attention_ocr/python/eval.py
research/attention_ocr/python/eval.py
+1
-1
research/attention_ocr/python/model_export.py
research/attention_ocr/python/model_export.py
+1
-1
research/attention_ocr/python/model_export_test.py
research/attention_ocr/python/model_export_test.py
+4
-3
research/attention_ocr/python/train.py
research/attention_ocr/python/train.py
+1
-1
No files found.
research/attention_ocr/python/common_flags.py
View file @
a56d7ab3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
import
logging
import
logging
import
sys
import
sys
from
tensorflow.
python.platform
import
flags
from
tensorflow.
compat.v1
import
flags
import
datasets
import
datasets
import
model
import
model
...
...
research/attention_ocr/python/datasets/fsns_test.py
View file @
a56d7ab3
...
@@ -22,8 +22,9 @@ from tensorflow.contrib import slim
...
@@ -22,8 +22,9 @@ from tensorflow.contrib import slim
from
datasets
import
fsns
from
datasets
import
fsns
from
datasets
import
unittest_utils
from
datasets
import
unittest_utils
from
tensorflow.compat.v1
import
flags
FLAGS
=
tf
.
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
def
get_test_split
():
def
get_test_split
():
...
...
research/attention_ocr/python/demo_inference.py
View file @
a56d7ab3
...
@@ -19,7 +19,7 @@ import numpy as np
...
@@ -19,7 +19,7 @@ import numpy as np
import
PIL.Image
import
PIL.Image
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.
python.platform
import
flags
from
tensorflow.
compat.v1
import
flags
from
tensorflow.python.training
import
monitored_session
from
tensorflow.python.training
import
monitored_session
import
common_flags
import
common_flags
...
...
research/attention_ocr/python/demo_inference_test.py
View file @
a56d7ab3
...
@@ -4,6 +4,7 @@ import os
...
@@ -4,6 +4,7 @@ import os
import
demo_inference
import
demo_inference
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.python.training
import
monitored_session
from
tensorflow.python.training
import
monitored_session
from
tensorflow.compat.v1
import
flags
_CHECKPOINT
=
'model.ckpt-399731'
_CHECKPOINT
=
'model.ckpt-399731'
_CHECKPOINT_URL
=
'http://download.tensorflow.org/models/attention_ocr_2017_08_09.tar.gz'
_CHECKPOINT_URL
=
'http://download.tensorflow.org/models/attention_ocr_2017_08_09.tar.gz'
...
@@ -19,7 +20,7 @@ class DemoInferenceTest(tf.test.TestCase):
...
@@ -19,7 +20,7 @@ class DemoInferenceTest(tf.test.TestCase):
'Please download and extract it from %s'
%
'Please download and extract it from %s'
%
(
filename
,
_CHECKPOINT_URL
))
(
filename
,
_CHECKPOINT_URL
))
self
.
_batch_size
=
32
self
.
_batch_size
=
32
tf
.
flags
.
FLAGS
.
dataset_dir
=
os
.
path
.
join
(
flags
.
FLAGS
.
dataset_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'datasets/testdata/fsns'
)
os
.
path
.
dirname
(
__file__
),
'datasets/testdata/fsns'
)
def
test_moving_variables_properly_loaded_from_a_checkpoint
(
self
):
def
test_moving_variables_properly_loaded_from_a_checkpoint
(
self
):
...
...
research/attention_ocr/python/eval.py
View file @
a56d7ab3
...
@@ -21,7 +21,7 @@ python eval.py
...
@@ -21,7 +21,7 @@ python eval.py
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.contrib
import
slim
from
tensorflow.contrib
import
slim
from
tensorflow
import
app
from
tensorflow
import
app
from
tensorflow.
python.platform
import
flags
from
tensorflow.
compat.v1
import
flags
import
data_provider
import
data_provider
import
common_flags
import
common_flags
...
...
research/attention_ocr/python/model_export.py
View file @
a56d7ab3
...
@@ -25,7 +25,7 @@ import os
...
@@ -25,7 +25,7 @@ import os
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow
import
app
from
tensorflow
import
app
from
tensorflow.contrib
import
slim
from
tensorflow.contrib
import
slim
from
tensorflow.
python.platform
import
flags
from
tensorflow.
compat.v1
import
flags
import
common_flags
import
common_flags
import
model_export_lib
import
model_export_lib
...
...
research/attention_ocr/python/model_export_test.py
View file @
a56d7ab3
...
@@ -19,6 +19,7 @@ import os
...
@@ -19,6 +19,7 @@ import os
import
numpy
as
np
import
numpy
as
np
from
absl.testing
import
flagsaver
from
absl.testing
import
flagsaver
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.compat.v1
import
flags
import
common_flags
import
common_flags
import
model_export
import
model_export
...
@@ -51,9 +52,9 @@ class AttentionOcrExportTest(tf.test.TestCase):
...
@@ -51,9 +52,9 @@ class AttentionOcrExportTest(tf.test.TestCase):
msg
=
'Missing checkpoint file %s. '
msg
=
'Missing checkpoint file %s. '
'Please download and extract it from %s'
%
'Please download and extract it from %s'
%
(
filename
,
_CHECKPOINT_URL
))
(
filename
,
_CHECKPOINT_URL
))
tf
.
flags
.
FLAGS
.
dataset_name
=
'fsns'
flags
.
FLAGS
.
dataset_name
=
'fsns'
tf
.
flags
.
FLAGS
.
checkpoint
=
_CHECKPOINT
flags
.
FLAGS
.
checkpoint
=
_CHECKPOINT
tf
.
flags
.
FLAGS
.
dataset_dir
=
os
.
path
.
join
(
flags
.
FLAGS
.
dataset_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'datasets/testdata/fsns'
)
os
.
path
.
dirname
(
__file__
),
'datasets/testdata/fsns'
)
tf
.
test
.
TestCase
.
setUp
(
self
)
tf
.
test
.
TestCase
.
setUp
(
self
)
_clean_up
()
_clean_up
()
...
...
research/attention_ocr/python/train.py
View file @
a56d7ab3
...
@@ -23,7 +23,7 @@ import logging
...
@@ -23,7 +23,7 @@ import logging
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.contrib
import
slim
from
tensorflow.contrib
import
slim
from
tensorflow
import
app
from
tensorflow
import
app
from
tensorflow.
python.platform
import
flags
from
tensorflow.
compat.v1
import
flags
from
tensorflow.contrib.tfprof
import
model_analyzer
from
tensorflow.contrib.tfprof
import
model_analyzer
import
data_provider
import
data_provider
...
...
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