예제 #1
0
    def load(model_path, weight_path=None, bigdl_type="float"):
        """
        Load an existing Analytics Zoo model defined in Keras-style(with weights).

        :param model_path: The path to load the saved model.
                          Local file system, HDFS and Amazon S3 are supported.
                          HDFS path should be like 'hdfs://[host]:[port]/xxx'.
                          Amazon S3 path should be like 's3a://bucket/xxx'.
        :param weight_path: The path for pre-trained weights if any. Default is None.
        :return: An Analytics Zoo model.
        """
        jmodel = callBigDlFunc(bigdl_type, "netLoad", model_path, weight_path)
        return KerasNet.of(jmodel, bigdl_type)
예제 #2
0
 def _do_load(jmodel, bigdl_type="float"):
     model = ZooModel._do_load(jmodel, bigdl_type)
     labor_model = callZooFunc(bigdl_type, "getModule", jmodel)
     model.model = KerasNet(labor_model)
     return model