aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools
diff options
context:
space:
mode:
authorGravatar Anna R <annarev@google.com>2018-09-21 12:50:46 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-21 12:55:03 -0700
commit9f2dd5cc693f3dca077392dff76f740969e9fea8 (patch)
tree793bd1affcd9b6a64b85784f75519b34ba210a60 /tensorflow/tools
parent25c1a4441bbf364c8ed263f75e0bebad30f6599c (diff)
Print errors if --outfile or --outtree are not passed to the tf_upgrade_v2.py
script. PiperOrigin-RevId: 214029776
Diffstat (limited to 'tensorflow/tools')
-rw-r--r--tensorflow/tools/compatibility/tf_upgrade_v2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/tools/compatibility/tf_upgrade_v2.py b/tensorflow/tools/compatibility/tf_upgrade_v2.py
index 38216ce9b1..53c546b10c 100644
--- a/tensorflow/tools/compatibility/tf_upgrade_v2.py
+++ b/tensorflow/tools/compatibility/tf_upgrade_v2.py
@@ -120,10 +120,18 @@ Simple usage:
report_filename = args.report_filename
files_processed = 0
if args.input_file:
+ if not args.output_file:
+ raise ValueError(
+ "--outfile=<output file> argument is required when converting a "
+ "single file.")
files_processed, report_text, errors = upgrade.process_file(
args.input_file, args.output_file)
files_processed = 1
elif args.input_tree:
+ if not args.output_tree:
+ raise ValueError(
+ "--outtree=<output directory> argument is required when converting a "
+ "file tree.")
files_processed, report_text, errors = upgrade.process_tree(
args.input_tree, args.output_tree, args.copy_other_files)
else: