docstr: Load network weights.
  data_path: The path to the numpy-serialized network weights
  ignore_missing: If true, serialized weights for missing layers are ignored.
docstr_tok: ["Load","network","weights",".","data_path",":","The","path","to","the","numpy-serialized","network","weights","ignore_missing",":","If","true",",","serialized","weights","for","missing","layers","are","ignored","."]
code: def load(self, data_path, exe=None, place=None, ignore_missing=False):
      """Load network weights.
      data_path: The path to the numpy-serialized network weights
      ignore_missing: If true, serialized weights for missing layers are ignored.
      """
      fluid = import_fluid()
      # load fluid mode directly
      if os.path.isdir(data_path):
          assert (
              exe is not None
          ), "must provide a executor to load fluid model"
          fluid.io.load_persistables(executor=exe, dirname=data_path)
          return True
  
      # load model from a npy file
      if exe is None or place is None:
          if self.paddle_env is None:
              place = fluid.CPUPlace()
              exe = fluid.Executor(place)
              self.paddle_env = {"place": place, "exe": exe}
              exe = exe.run(fluid.default_startup_program())
          else:
              place = self.paddle_env["place"]
              exe = self.paddle_env["exe"]
  
      data_dict = np.load(data_path).item()
      for op_name in data_dict:
          if op_name == "caffe2fluid_name_trace":
              self.name_trace = data_dict[op_name]
              continue
  
          layer = self.layers[op_name]
          for param_name, data in list(data_dict[op_name].items()):
              try:
                  name = "%s_%s" % (op_name, param_name)
                  v = fluid.global_scope().find_var(name)
                  w = v.get_tensor()
                  w.set(data.reshape(w.shape()), place)
              except ValueError:
                  if not ignore_missing:
                      raise
      return True
  
imports: from __future__ import print_function
  from builtins import str
  from past.builtins import basestring
  from builtins import object
  import sys
  import os
  import math
  import numpy
label_desc: Use image node_id 3 for calling the Network obj's underlying member method code with example usage: obj.load(data_path, exe, place, ignore_missing) and returns: True, True