vgslify.utils package
Submodules
vgslify.utils.model_to_spec module
- vgslify.utils.model_to_spec.model_to_spec(model)[source]
Convert a deep learning model (TensorFlow or PyTorch) to a VGSL spec string.
- Parameters:
model (Model) – The deep learning model to be converted. Can be a TensorFlow model (tf.keras.models.Model) or a PyTorch model (torch.nn.Module).
- Returns:
VGSL spec string.
- Return type:
str
- Raises:
ValueError – If the model is not supported or cannot be parsed.
Examples
>>> from vgslify.utils import model_to_spec >>> import tensorflow as tf >>> model = tf.keras.models.load_model("path_to_model.h5") >>> spec_string = model_to_spec(model) >>> print(spec_string)