Protecting Model Files for Python

Script Envelope supports model file protection for TensorFlow and Pytorch models as described in this section.

TensorFlow Model File Protection

This section describes the use and limitations of Script Envelope for TensorFlow model file protection.

Script Envelope supports protecting model files for TensorFlow in Python, along with the Python script files. The supported model files include the hdf5 format (file extensions "h5" and "hdf5") and the keras format ("keras" file extension).

Tested version: TensorFlow 2.18 with Python 3.8 through 3.11.

If you are using different versions of TensorFlow or Python, and the loading of the protected model fails, contact Thales technical support.

NOTE   Model files must be included in the Script Envelope project file.

PyTorch Model File Protection

Script Envelope supports protecting model files for PyTorch in Python, along with the Python script files. The supported model files include file extension "pt" and "pth".

Tested version: PyTorch 2.5/2.0/1.12 with Python 3.

If you are using different versions of PyTorch or Python, and the loading of the protected model fails, contact Thales technical support.

NOTE   Model files must be included in the Script Envelope project file.