add flclient log and fix issue

This commit is contained in:
zhengjun10 2022-02-16 16:11:20 +08:00
parent 9ecfccf4f6
commit b09af08420
2 changed files with 6 additions and 6 deletions

View File

@ -277,13 +277,13 @@ public abstract class Client {
Model model = new Model();
boolean isSuccess = model.loadModel(modelPath);
if (!isSuccess) {
logger.severe(Common.addTag("load model failed:" + modelPath));
logger.severe(Common.addTag("load model failed:" + modelPath+" ,please check model is valid or disk" +
"space is enough,please check lite log for detail."));
return Optional.empty();
}
trainSession = LiteSession.createSession(msConfig);
if (trainSession == null) {
logger.severe(Common.addTag("init session failed,please check model :" + modelPath + " is valid or " +
"disk space is enough"));
logger.severe(Common.addTag("init session failed.please check lite log for detail."));
msConfig.free();
model.free();
return Optional.empty();
@ -291,7 +291,7 @@ public abstract class Client {
msConfig.free();
isSuccess = trainSession.compileGraph(model);
if (!isSuccess) {
logger.severe(Common.addTag("compile graph failed:" + modelPath));
logger.severe(Common.addTag("compile graph failed,please check lite log for detail."));
model.free();
trainSession.free();
return Optional.empty();
@ -302,7 +302,7 @@ public abstract class Client {
trainSession = TrainSession.createTrainSession(modelPath, msConfig, false);
if (trainSession == null) {
logger.severe(Common.addTag("init session failed,please check model :" + modelPath + " is valid or " +
"disk space is enough"));
"disk space is enough.please check lite log for detail."));
return Optional.empty();
}
return Optional.of(trainSession);

View File

@ -106,7 +106,7 @@ int ReduceBaseCPUKernel::Prepare() {
MS_CHECK_FALSE_MSG((axes_tensor->data_type() != kNumberTypeInt && axes_tensor->data_type() != kNumberTypeInt32),
RET_ERROR, "The data type of axes tensor should be int32");
num_axes_ = axes_tensor->ElementsNum();
if (num_axes_ <= 0 || num_axes_ > MAX_SHAPE_SIZE) {
if (axes_tensor->data() != nullptr && (num_axes_ <= 0 || num_axes_ > MAX_SHAPE_SIZE)) {
MS_LOG(ERROR) << "input axes invalid.";
return RET_ERROR;
}