MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / load

Method load

tensorlayer/models/core.py:814–836  ·  view source on GitHub ↗

Load model from a given file, which should be previously saved by Model.save(). This function load can load both the architecture of neural networks and weights (optional, and needs to be saved in Model.save()). When a model is loaded by this function load, there is no need

(filepath, load_weights=True)

Source from the content-addressed store, hash-verified

812
813 @staticmethod
814 def load(filepath, load_weights=True):
815 """
816 Load model from a given file, which should be previously saved by Model.save().
817 This function load can load both the architecture of neural networks and weights (optional, and needs to be saved in Model.save()).
818 When a model is loaded by this function load, there is no need to reimplement or declare the architecture of the model explicitly in code.
819 WARNING: If the model contains Lambda / ElementwiseLambda layer, please check the documentation of Lambda / ElementwiseLambda layer and find out the cases that have / have not been supported by Model.load().
820
821 Parameters
822 ----------
823 filepath : str
824 Filename from which the model will be loaded.
825 load_weights : bool
826 Whether to load model weights.
827
828 Examples
829 --------
830 >>> net = tl.models.vgg16()
831 >>> net.save('./model.h5', save_weights=True)
832 >>> new_net = Model.load('./model.h5', load_weights=True)
833 """
834 # TODO: support loading LambdaLayer that includes parametric self defined function with outside variables
835 M = utils.load_hdf5_graph(filepath=filepath, load_weights=load_weights)
836 return M
837
838 def save_weights(self, filepath, format=None):
839 """Input filepath, save model weights into a file of given format.

Callers 15

unpickleFunction · 0.45
load_cropped_svhnFunction · 0.45
load_imdb_datasetFunction · 0.45
load_npzFunction · 0.45
load_and_assign_npz_dictFunction · 0.45
load_npy_to_anyFunction · 0.45
unpickleFunction · 0.45
load_imdb_datasetFunction · 0.45
restore_modelFunction · 0.45
test_saveMethod · 0.45
test_saveMethod · 0.45
test_saveMethod · 0.45

Calls

no outgoing calls