Module functions

TM NPU MicroPython

Product
SIMACTIC S7-1500 TM NPU 2.0
Language
en-US
Category
Manual

Initializes and returns a NeuralNet object.

Note:

More details on troubleshooting and exceptions can be found in Chapter 6: General notes and troubleshooting.

  • model_buffer

    The supplied raw network blob data.

    Note:

    If a corrupted neural network is provided, an exception is thrown. However, if a formally accepted neural network that is not suitable for the purpose of the app is used (e.g. if the required buffer memory size is too large or the network includes not supported layers), no exception is thrown and the app stops working. In this case, an error is indicated by the debug server and the servicedata.

  • shaves_nn

    The number of SHAVEs assigned to the execution of the neural network.

    Note:

    Currently only the value of ‘4’ is accepted, otherwise an exception is thrown. The value does not need to be assigned since it is set per default. For details regarding SHAVEs, consult Chapter 4 Use of shaves and hardware accelerators.

  • use_cnns

    Should be a tuple of boolean values, to indicate whether or not to use the available CNN accelerators (use_cnn_1, use_cnn_2).

    Note:

    Currently only the value of (True, True) is accepted, otherwise an exception is thrown. The value does not need to be assigned since it is set per default. Both CNN accelerators are to be activated for the network. For details regarding SHAVEs, consult Chapter 4 Use of shaves and hardware accelerators.