PyTorch¶
The Snowflake ML Model Registry supports models created using PyTorch (models derived from torch.nn.Module).
The following additional options can be used in the options dictionary when you call log_model:
Option |
Description |
|---|---|
|
A list of the names of the methods available on the model object. PyTorch models have the following target method by default:
|
|
The version of the CUDA runtime to be used when deploying to a platform with GPU; defaults to 11.8. If manually set
to |
|
Whether the model expects multiple tensor inputs. Defaults to |
You must specify either the sample_input_data or signatures parameter when logging a PyTorch model so
that the registry knows the signatures of the target methods.
Note
When using pandas DataFrames (which use float64 by default), ensure your PyTorch model layers are created
with dtype=torch.float64 to avoid dtype mismatch errors.
Example¶
This example assumes reg is an instance of snowflake.ml.registry.Registry.