To enable the export stage with a NSFW model, configure the configuration files:
In the
defaults
section ofconf/config.yaml
, update theexport
field to point to the desired NSFW configuration file. For example, if you want to use thensfw/export_nsfw
configuration, change theexport
field toclip/export_nsfw
.defaults: - export: nsfw/export_nsfw ...
In the
stages
field ofconf/config.yaml
, make sure theexport
stage is included. For example,stages: - export ...
Configure
infer.max_batch_size
of theconf/export/nsfw/export_nsfw.yaml
file to set the max_batch_size to use for the ONNX and NVIDIA TensorRT model.
4. Set the resolution of the model with max_dim
in the infer
field.
This will be used to generate the ONNX and NVIDIA TensorRT formats.
Remarks:
To load a pretrained checkpoint for inference, set the
restore_from_path
field in themodel
section to the path of the pretrained checkpoint in.nemo
format inconf/export/nsfw/export_nsfw.yaml
.