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

polish error doc (#17772)

test=develop
上级 4c5df40e
......@@ -615,11 +615,21 @@ void ParallelExecutor::FeedAndSplitTensorIntoLocalScopes(
const std::unordered_map<std::string, LoDTensor> &tensors) {
for (auto pair : tensors) {
auto lod_tensors = pair.second.SplitLoDTensor(member_->places_);
PADDLE_ENFORCE_EQ(
member_->places_.size(), lod_tensors.size(),
"The number of samples of current batch is less than the count of "
"devices, currently, it is not allowed. (%d vs %d)",
member_->places_.size(), lod_tensors.size());
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(),
(is_cpu_place ? "CPU" : "GPU"));
if (is_cpu_place) {
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) {
// TODO(panxy0718): Do I need to delete this var?
auto t =
......
......@@ -107,7 +107,8 @@ static inline void* GetDsoHandleFromDefaultPath(const std::string& dso_path,
if (nullptr == dso_handle) {
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册