Repository: incubator-singa
Updated Branches:
  refs/heads/master 4c289744d -> 06163950b


SINGA-12 Supprt Checkpoint and Restore

Fixbug from Resume function, which generated errors when irregular files are 
put into the checkpoint folder.
Now irregular files will be reported and ignored.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/06163950
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/06163950
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/06163950

Branch: refs/heads/master
Commit: 06163950bff355ce3c83764ab51f07ee95993e09
Parents: 4c28974
Author: Wei Wang <[email protected]>
Authored: Tue Jul 28 19:50:10 2015 +0800
Committer: Wei Wang <[email protected]>
Committed: Tue Jul 28 19:50:10 2015 +0800

----------------------------------------------------------------------
 src/trainer/trainer.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/06163950/src/trainer/trainer.cc
----------------------------------------------------------------------
diff --git a/src/trainer/trainer.cc b/src/trainer/trainer.cc
index d5c885f..9f245a2 100644
--- a/src/trainer/trainer.cc
+++ b/src/trainer/trainer.cc
@@ -207,8 +207,9 @@ void Trainer::Resume(ModelProto* modelConf) {
     tinydir_readfile(&dir, &file);
     tinydir_next(&dir);
     char* ch = strstr(file.name, "step");
-    if (ch == nullptr && file.name[0] != '.' && file.name[1] != '.') {
-      LOG(INFO) << "Irregular file in checkpoint folder: " << file.name;
+    if (ch == nullptr) {
+      if (file.name[0] != '.')
+        LOG(INFO) << "Irregular file in checkpoint folder: " << file.name;
       continue;
     }
 

Reply via email to