Fix fallback to default paths in MNIST example (#821)

If --train-sets or --valid-sets are not provided, the fallback to the
hard-coded paths does not occur. This commit requires that these
entities have a non-empty value.
This commit is contained in:
Graeme 2021-03-12 09:42:43 +00:00 committed by GitHub
parent f74d055d20
commit db399d749c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,9 @@ using namespace marian;
int main(int argc, char** argv) {
auto options = parseOptions(argc, argv, cli::mode::training, false);
if(!options->has("train-sets"))
if(!options->hasAndNotEmpty("train-sets"))
options->set("train-sets", TRAIN_SET);
if(!options->has("valid-sets"))
if(!options->hasAndNotEmpty("valid-sets"))
options->set("valid-sets", VALID_SET);
if(options->get<std::string>("type") != "mnist-lenet")