Important
NeMo 2.0 is an experimental feature and currently released in the dev container only: nvcr.io/nvidia/nemo:dev. Please refer to NeMo 2.0 overview for information on getting started.
Evaluation#
For the Vision Transformer, our evaluation script processes the ImageNet 1K validation folder and computes the final validation accuracy.
To enable the evaluation stage with a ViT model, configure the configuration files:
In the
defaultssection ofconf/config.yaml, update theevaluationfield to point to the desired ViT configuration file. For example, if you want to use thevit/imagenet_valconfiguration, change theevaluationfield tovit/imagenet_val.defaults: - evaluation: vit/imagenet_val ...
In the
stagesfield ofconf/config.yaml, make sure theevaluationstage is included. For example,stages: - evaluation ...
Configure
imagenet_valfield ofconf/evaluation/vit/imagenet_val.yamlto be the ImageNet 1K validation folder.Execute the launcher pipeline:
python3 main.py.
Remarks:
To load a pretrained checkpoint for inference, set the
restore_from_pathfield in themodelsection to the path of the pretrained checkpoint in.nemoformat inconf/evaluation/vit/imagenet_val.yaml. By default, this field links to the.nemoformat checkpoint located in the ImageNet 1K fine-tuning checkpoints folder.We highly recommend users to use the same precision (i.e.,
trainer.precision) for evaluation as was used during training.