Beispiel #1
0
def load_model(data_type, filename, device=None):
    '''
    Load the network in `model_file`, that has been saved using
    `:func:save_model`.

    Args:
        data_type ('float' or 'double', or NumPy type): data type of the operation
        filename (`str`): filename to load the model from
        device (:class:`cntk.DeviceDescriptor`, default to default device): instance of DeviceDescriptor

    Returns:
        root node
    '''
    from cntk.utils import sanitize_dtype_cntk
    data_type = sanitize_dtype_cntk(data_type)
    if not device:
        device = cntk_py.DeviceDescriptor.use_default_device()
    return cntk_py.load_legacy_model(data_type, filename)
Beispiel #2
0
def load_model(data_type, filename, device=None):
    '''
    Load the network in `model_file`, that has been saved using
    `:func:save_model`.

    Args:
        data_type ('float' or 'double', or NumPy type): data type of the operation
        filename (`str`): filename to load the model from
        device (:class:`cntk.DeviceDescriptor`, default to default device): instance of DeviceDescriptor

    Returns:
        root node
    '''
    from cntk.utils import sanitize_dtype_cntk
    data_type = sanitize_dtype_cntk(data_type)
    if not device:
        device = use_default_device()
    return cntk_py.load_legacy_model(data_type, filename)