diff --git a/paddle/fluid/platform/dynload/tensorrt.cc b/paddle/fluid/platform/dynload/tensorrt.cc index d3f3eeadee1eba593576997498e7a2475a81fb9d..b75ef76736a310c895c5a09ce26fedc9ecd3d53f 100644 --- a/paddle/fluid/platform/dynload/tensorrt.cc +++ b/paddle/fluid/platform/dynload/tensorrt.cc @@ -41,10 +41,20 @@ void* GetDsoHandle(const std::string& dso_name) { void* dso_handle = dlopen(dso_name.c_str(), dynload_flags); - PADDLE_ENFORCE_NOT_NULL(dso_handle, - paddle::platform::errors::NotFound( - "TensorRT is needed, " - "but TensorRT dynamic library is not found.")); + PADDLE_ENFORCE_NOT_NULL( + dso_handle, + paddle::platform::errors::NotFound( + "TensorRT is needed, " + "but TensorRT dynamic library is not found.\n" + " Suggestions:\n" + " 1. Check if the TensorRT is installed correctly and its version" + " is matched with paddlepaddle you installed.\n" + " 2. Configure environment variables as " + "follows:\n" + " - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`\n" + " - Windows: set PATH by `set PATH=XXX;%PATH%`\n" + " - Mac: set DYLD_LIBRARY_PATH by `export " + "DYLD_LIBRARY_PATH=...`\n")); return dso_handle; } diff --git a/paddle/phi/backends/dynload/tensorrt.cc b/paddle/phi/backends/dynload/tensorrt.cc index 7380788faccf1843d879060c28a5f6695b8e7fba..ff4217ce0205454f40b9ad7d1386ec6fa2d01010 100644 --- a/paddle/phi/backends/dynload/tensorrt.cc +++ b/paddle/phi/backends/dynload/tensorrt.cc @@ -42,8 +42,19 @@ void* GetDsoHandle(const std::string& dso_name) { PADDLE_ENFORCE_NOT_NULL( dso_handle, - phi::errors::NotFound("TensorRT is needed, " - "but TensorRT dynamic library is not found.")); + phi::errors::NotFound( + "TensorRT is needed, " + "but TensorRT dynamic library is not found.\n" + " Suggestions:\n" + " 1. Check if the TensorRT is installed correctly and its version" + " is matched with paddlepaddle you installed.\n" + " 2. Configure environment variables as " + "follows:\n" + " - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`\n" + " - Windows: set PATH by `set PATH=XXX;%PATH%`\n" + " - Mac: set DYLD_LIBRARY_PATH by `export " + "DYLD_LIBRARY_PATH=...`\n")); + return dso_handle; } diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index a4f1dc1fb4477ef13e204d6446c4f3e1d95c0d8c..70a6d848e1db8429f9276490fed7c39723fc6184 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -1272,7 +1272,7 @@ def broadcast_tensors(input, name=None): last_index = output_shape_r_last_tensor_index[i] raise TypeError( "Input tensors to broadcast_tensors does not follow bcast semantics" - "Tensor {last_index} conflicts with Tensor {j} in reversed dimension {i}" + f"Tensor {last_index} conflicts with Tensor {j} in reversed dimension {i}" ) if output_shape_r[i] <= shape[i]: output_shape_r[i] = shape[i]