You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/09/27 18:24:27 UTC

[GitHub] [tvm] areusch commented on a change in pull request #9074: Improve tvmc error message from lazy-loading frontend imports

areusch commented on a change in pull request #9074:
URL: https://github.com/apache/tvm/pull/9074#discussion_r716938332



##########
File path: tests/python/driver/tvmc/test_frontends.py
##########
@@ -211,3 +212,43 @@ def test_load_model___wrong_language__to_pytorch(tflite_mobilenet_v1_1_quant):
             model_format="pytorch",
             shape_dict={"input": [1, 3, 224, 224]},
         )
+
+
+@mock.patch("tvm.driver.tvmc.frontends.import_keras")
+def test_import_keras_friendly_message(import_keras_mock, keras_resnet50):
+    import_keras_mock.side_effect = TVMCException("keras is not installed")

Review comment:
       it's probably okay to do this right around the call site, but it could get tricky if exception handlers also late-import stuff e.g. pytest's is fairly complex and i don't know what it does entirely.

##########
File path: tests/python/driver/tvmc/test_frontends.py
##########
@@ -211,3 +212,43 @@ def test_load_model___wrong_language__to_pytorch(tflite_mobilenet_v1_1_quant):
             model_format="pytorch",
             shape_dict={"input": [1, 3, 224, 224]},
         )
+
+
+@mock.patch("tvm.driver.tvmc.frontends.import_keras")
+def test_import_keras_friendly_message(import_keras_mock, keras_resnet50):

Review comment:
       agreed--unless there's some strange impl detail here? i'd prefer if we could not skip these based on whether those packages are present.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org