Unverified Commit a56d7ab3 authored by Leandro Schelb's avatar Leandro Schelb Committed by GitHub
Browse files

Fixed deprecated tf.flags (#9912)

parent 2b68aa95
......@@ -17,7 +17,7 @@
import logging
import sys
from tensorflow.python.platform import flags
from tensorflow.compat.v1 import flags
import datasets
import model
......
......@@ -22,8 +22,9 @@ from tensorflow.contrib import slim
from datasets import fsns
from datasets import unittest_utils
from tensorflow.compat.v1 import flags
FLAGS = tf.flags.FLAGS
FLAGS = flags.FLAGS
def get_test_split():
......
......@@ -19,7 +19,7 @@ import numpy as np
import PIL.Image
import tensorflow as tf
from tensorflow.python.platform import flags
from tensorflow.compat.v1 import flags
from tensorflow.python.training import monitored_session
import common_flags
......
......@@ -4,6 +4,7 @@ import os
import demo_inference
import tensorflow as tf
from tensorflow.python.training import monitored_session
from tensorflow.compat.v1 import flags
_CHECKPOINT = 'model.ckpt-399731'
_CHECKPOINT_URL = 'http://download.tensorflow.org/models/attention_ocr_2017_08_09.tar.gz'
......@@ -19,7 +20,7 @@ class DemoInferenceTest(tf.test.TestCase):
'Please download and extract it from %s' %
(filename, _CHECKPOINT_URL))
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')
def test_moving_variables_properly_loaded_from_a_checkpoint(self):
......
......@@ -21,7 +21,7 @@ python eval.py
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow import app
from tensorflow.python.platform import flags
from tensorflow.compat.v1 import flags
import data_provider
import common_flags
......
......@@ -25,7 +25,7 @@ import os
import tensorflow as tf
from tensorflow import app
from tensorflow.contrib import slim
from tensorflow.python.platform import flags
from tensorflow.compat.v1 import flags
import common_flags
import model_export_lib
......
......@@ -19,6 +19,7 @@ import os
import numpy as np
from absl.testing import flagsaver
import tensorflow as tf
from tensorflow.compat.v1 import flags
import common_flags
import model_export
......@@ -51,9 +52,9 @@ class AttentionOcrExportTest(tf.test.TestCase):
msg='Missing checkpoint file %s. '
'Please download and extract it from %s' %
(filename, _CHECKPOINT_URL))
tf.flags.FLAGS.dataset_name = 'fsns'
tf.flags.FLAGS.checkpoint = _CHECKPOINT
tf.flags.FLAGS.dataset_dir = os.path.join(
flags.FLAGS.dataset_name = 'fsns'
flags.FLAGS.checkpoint = _CHECKPOINT
flags.FLAGS.dataset_dir = os.path.join(
os.path.dirname(__file__), 'datasets/testdata/fsns')
tf.test.TestCase.setUp(self)
_clean_up()
......
......@@ -23,7 +23,7 @@ import logging
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow import app
from tensorflow.python.platform import flags
from tensorflow.compat.v1 import flags
from tensorflow.contrib.tfprof import model_analyzer
import data_provider
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment