-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[TVMC] compile: Check if FILE exists #10608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TVMC] compile: Check if FILE exists #10608
Conversation
|
cc @leandron |
leandron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix @gromero!
|
@leandron Thanks for the review. Do you know what's not pleasing the CI now? The result says: I really have no clue what happens here... |
|
Looks like a transient: see |
@leandron hmm I see it now. But also it says: and since it's in the CI, shouldn't we mark it as "xfail" ? I think reporting every time in HG it fails in the CI is a big ask no? |
|
Anyways, I'm re-triggering 👍 |
eb20470 to
7765793
Compare
python/tvm/driver/tvmc/compiler.py
Outdated
| 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!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about just checking if os.exists(args.FILE) rather than assuming all FileNotFoundError relate to the input file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 a directory, which is also invalid in that context. PTAL. Thanks!
Currently when a non-existing FILE is passed to 'tvmc compile' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, informing the user about the non-existing FILE before exiting. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
7765793 to
6dd1bc1
Compare
Currently when a non-existing FILE is passed to 'tvmc tune' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, kindly informing the user about the non-existing FILE before exiting. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Currently when a non-existing FILE is passed to 'tvmc tune' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, kindly informing the user about the non-existing FILE before exiting. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Currently when a non-existing FILE is passed to 'tvmc tune' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, kindly informing the user about the non-existing FILE before exiting.
Currently when a non-existing FILE is passed to 'tvmc compile' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, informing the user about the non-existing FILE before exiting. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Currently when a non-existing FILE is passed to 'tvmc tune' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, kindly informing the user about the non-existing FILE before exiting.
Currently when a non-existing FILE is passed to 'tvmc tune' it throws a traceback because a FileNotFoundError exception is not handled. Since there is no need for such abrupt exit, and the trace can also confuse users, this commit fixes it by checking if FILE indeed exists, kindly informing the user about the non-existing FILE before exiting.
Currently when a non-existing FILE is passed to 'tvmc compile' it throws
a traceback because a FileNotFoundError exception is not handled. Since
there is no need for such abrupt exit, and the trace can also confuse
users, this commit fixes it by checking if FILE indeed exists, informing
the user about the non-existing FILE before exiting.