未验证 提交 863c7516 编写于 作者: C chengduo 提交者: GitHub

polish error doc (#17772)

test=develop
上级 4c5df40e
...@@ -615,11 +615,21 @@ void ParallelExecutor::FeedAndSplitTensorIntoLocalScopes( ...@@ -615,11 +615,21 @@ void ParallelExecutor::FeedAndSplitTensorIntoLocalScopes(
const std::unordered_map<std::string, LoDTensor> &tensors) { const std::unordered_map<std::string, LoDTensor> &tensors) {
for (auto pair : tensors) { for (auto pair : tensors) {
auto lod_tensors = pair.second.SplitLoDTensor(member_->places_); auto lod_tensors = pair.second.SplitLoDTensor(member_->places_);
PADDLE_ENFORCE_EQ( if (member_->places_.size() != lod_tensors.size()) {
bool is_cpu_place = platform::is_cpu_place(member_->places_.front());
auto error_info = string::Sprintf(
"The number(%d) of samples of "
"current batch is less than the count(%d) of "
"devices(%s), currently, it is not allowed. ",
member_->places_.size(), lod_tensors.size(), member_->places_.size(), lod_tensors.size(),
"The number of samples of current batch is less than the count of " (is_cpu_place ? "CPU" : "GPU"));
"devices, currently, it is not allowed. (%d vs %d)", if (is_cpu_place) {
member_->places_.size(), lod_tensors.size()); error_info +=
"You should set the environment variable CPU_NUM in the system "
"to determine the number of devices you need.";
}
PADDLE_THROW(error_info);
}
for (size_t j = 0; j < member_->places_.size(); ++j) { for (size_t j = 0; j < member_->places_.size(); ++j) {
// TODO(panxy0718): Do I need to delete this var? // TODO(panxy0718): Do I need to delete this var?
auto t = auto t =
......
...@@ -107,7 +107,8 @@ static inline void* GetDsoHandleFromDefaultPath(const std::string& dso_path, ...@@ -107,7 +107,8 @@ static inline void* GetDsoHandleFromDefaultPath(const std::string& dso_path,
if (nullptr == dso_handle) { if (nullptr == dso_handle) {
LOG(WARNING) << "Can not find library: " << dso_path LOG(WARNING) << "Can not find library: " << dso_path
<< ". Please try to add the lib path to LD_LIBRARY_PATH."; << ". The process maybe hang. Please try to add the lib path "
"to LD_LIBRARY_PATH.";
} }
return dso_handle; return dso_handle;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册