gromero commented on a change in pull request #10608:
URL: https://github.com/apache/tvm/pull/10608#discussion_r833756038



##########
File path: python/tvm/driver/tvmc/compiler.py
##########
@@ -153,7 +153,10 @@ def drive_compile(args):
         Zero if successfully completed
 
     """
-    tvmc_model = frontends.load_model(args.FILE, args.model_format, 
args.input_shapes)
+    try:
+        tvmc_model = frontends.load_model(args.FILE, args.model_format, 
args.input_shapes)
+    except FileNotFoundError:
+        raise TVMCException(f"Input file {args.FILE} does not exist!")

Review comment:
       @areusch yeah I was unsure about that option or the one I've used. Sure, 
let's use `os.path`. I just used `os.path.isfile()` instead of 
`os.path.exists()` because `exists()` will also return true if `FILE` is 
directory, which is also invalid in that case. PTAL. Thanks!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to