diff --git a/tensorflow/python/kernel_tests/decode_jpeg_op_test.py b/tensorflow/python/kernel_tests/decode_jpeg_op_test.py index ebde47e8ec7..94c12a67bbc 100644 --- a/tensorflow/python/kernel_tests/decode_jpeg_op_test.py +++ b/tensorflow/python/kernel_tests/decode_jpeg_op_test.py @@ -66,6 +66,13 @@ class DecodeJpegBenchmark(test.Benchmark): image_file_path = resource_loader.get_path_to_datafile( 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: image_content = variable_scope.get_variable( 'image_%s' % image_name,