浏览代码

save model

丁云鹏 5 月之前
父节点
当前提交
8116a955e6
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      recommend-model-produce/src/main/python/tools/static_ps_trainer_v2.py

+ 4 - 4
recommend-model-produce/src/main/python/tools/static_ps_trainer_v2.py

@@ -244,7 +244,7 @@ class Main(object):
 
         if fleet.is_first_worker():
             model_dir = "{}/{}".format(save_model_path, epochs)
-            oss_object_name = self.config.get("runner.oss_object_name")
+            oss_object_name = self.config.get("runner.oss_object_name", "dyp/dnn_plugin_new.tar.gz")
             # trans to new format
             # {"model_filename":"", "params_filename":""} fleet每个参数一个文件,需要同这种方式加载
             program, feed_target_names, fetch_targets = paddle.static.load_inference_model(
@@ -274,9 +274,9 @@ class Main(object):
             compress.compress_tar(os.path.join(model_dir, "dnn_plugin_new"), "dnn_plugin_new.tar.gz")
             client = HangZhouOSSClient("art-recommend")
             client.put_object_from_file(oss_object_name, "dnn_plugin_new.tar.gz")
-            while True:
-                time.sleep(300)
-                continue;
+        while True:
+            time.sleep(300)
+            continue;
 
         if reader_type == "InmemoryDataset":
             self.reader.release_memory()