Fix decode_jpeg_op_test benchmark.

PiperOrigin-RevId: 294724541
Change-Id: I8e2b9cccb5e3365f51d2144b58031f2b4ab05d64
This commit is contained in:
Gunhan Gulsoy 2020-02-12 12:14:18 -08:00 committed by TensorFlower Gardener
parent 05b4fe88ab
commit 0d204befa9

View File

@ -66,6 +66,13 @@ class DecodeJpegBenchmark(test.Benchmark):
image_file_path = resource_loader.get_path_to_datafile( image_file_path = resource_loader.get_path_to_datafile(
os.path.join('core', 'lib', 'jpeg', 'testdata', image_name)) os.path.join('core', 'lib', 'jpeg', 'testdata', image_name))
# resource_loader does not seem to work well under benchmark runners.
# So if the above path is not available, try another way to access the file:
if not os.path.exists(image_file_path):
image_file_path = resource_loader.get_path_to_datafile(
os.path.join(
'..', '..', 'core', 'lib', 'jpeg', 'testdata', image_name))
if tile is None: if tile is None:
image_content = variable_scope.get_variable( image_content = variable_scope.get_variable(
'image_%s' % image_name, 'image_%s' % image_name,