diff options
author | 2018-03-08 11:10:24 -0800 | |
---|---|---|
committer | 2018-03-08 11:10:24 -0800 | |
commit | 7a9419317f866349890a9f6633050c38e848aee4 (patch) | |
tree | 96dec922c93f81d50f6344d67d6802860abc5c70 | |
parent | f73d7c90ed05bcf9f36f6a3be0c29efa5fef0f6e (diff) |
Update tensorrt import exception.
-rw-r--r-- | tensorflow/contrib/tensorrt/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/contrib/tensorrt/__init__.py b/tensorflow/contrib/tensorrt/__init__.py index d53a05827a..a07b297900 100644 --- a/tensorflow/contrib/tensorrt/__init__.py +++ b/tensorflow/contrib/tensorrt/__init__.py @@ -18,16 +18,17 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function +from tensorflow.python.framework import errors + # pylint: disable=unused-import,wildcard-import,g-import-not-at-top try: from tensorflow.contrib.tensorrt.python import * -except Exception as e: +except errors.NotFoundError as e: no_trt_message = ( '**** Failed to initialize TensorRT. This is either because the TensorRT' ' installation path is not in LD_LIBRARY_PATH, or because you do not have' ' it installed. If not installed, please go to' ' https://developer.nvidia.com/tensorrt to download and install' ' TensorRT ****') - print(no_trt_message) - raise e + raise e(no_trt_message) # pylint: enable=unused-import,wildcard-import,g-import-not-at-top |