-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refine paddle_merge_model #4473
Conversation
@@ -28,7 +29,8 @@ using namespace std; // NOLINT | |||
int main(int argc, char** argv) { | |||
initMain(argc, argv); | |||
initPython(argc, argv); | |||
string confFile = TrainerConfigHelper::getConfigNameFromPath(FLAGS_model_dir); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这里加个对参数的检查吧:
if (FLAGS_model_dir.empty() || FLAGS_config_file.empty() || FLAGS_model_file.empty()) {
LOG(INFO) << "Usage: ./paddle_merge_model --model_dir=pass-00000 --config_file=config.py --model_file=model.paddle";
return;
}
@@ -19,7 +19,7 @@ import "ModelConfig.proto"; | |||
package paddle; | |||
|
|||
message OptimizationConfig { | |||
required int32 batch_size = 3; | |||
optional int32 batch_size = 3 [ default = 1 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用ModelConfig
之后,这里的修改是不是不需要了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我试了下,还是需要给batch_size
设置默认值的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -19,7 +19,7 @@ import "ModelConfig.proto"; | |||
package paddle; | |||
|
|||
message OptimizationConfig { | |||
required int32 batch_size = 3; | |||
optional int32 batch_size = 3 [ default = 1 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我试了下,还是需要给batch_size
设置默认值的。
fix #4465