Welcome to our Support Center

Read Weights

Description

Read all model weights (trainable and frozen) from the Training Session. The weights are stored in raw format to interpret them, you’ll need to convert them into n-dimensional typed arrays

Input parameters

 

 Training in object, training session.

 

Output parameters

 

 Training out object, training session.

 Weights Info cluster

weight_names : array, list of names identifying each weight tensor used for training or marked as frozen. These correspond to a subset of the model’s initializers, specifically those involved in learning or fixed parameters, not all initializers present in the ONNX graph.
raw_data_out : array, raw byte representation of each weight tensor, flattened into 1D. This field stores the actual binary content of the tensor.
data_shapes : array, shape of each tensor, provided as an array of dimensions. This allows reconstructing the original structure of the tensor from the flattened raw_data_out.
data_types : array, ONNX data type (enum) of each tensor, such as FLOAT, INT32, FLOAT16, etc. Defines how to interpret the raw bytes.
data_ranks : array, rank of each tensor (number of dimensions), for example :

        • Scalar → 0
        • Vector → 1
        • Matrix → 2
        • Higher-order tensors → 3+

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents