diff --git a/examples/arm/image_classification_example_ethos_u/model_export/README.md b/examples/arm/image_classification_example_ethos_u/model_export/README.md index 541edd75904..649737c54f3 100644 --- a/examples/arm/image_classification_example_ethos_u/model_export/README.md +++ b/examples/arm/image_classification_example_ethos_u/model_export/README.md @@ -30,6 +30,9 @@ Running this script achieves a test set accuracy of 86.10% in FP32. ## Export and quantize +The exporter requires a safetensors checkpoint. The training script saves +this format by default. Legacy PyTorch `.bin` checkpoints are not accepted. + The `export_deit.py` script can be run as follows: ```bash diff --git a/examples/arm/image_classification_example_ethos_u/model_export/export_deit.py b/examples/arm/image_classification_example_ethos_u/model_export/export_deit.py index cd8557588b7..60632a85858 100644 --- a/examples/arm/image_classification_example_ethos_u/model_export/export_deit.py +++ b/examples/arm/image_classification_example_ethos_u/model_export/export_deit.py @@ -96,7 +96,7 @@ def measure_accuracy(quantized_model, test_set): type=str, default="./deit-tiny-oxford-pet/final_model", required=True, - help="Path to the fine-tuned ViT model.", + help="Path to the fine-tuned ViT model saved in safetensors format.", ) argparser.add_argument( "--output-path", @@ -123,6 +123,7 @@ def measure_accuracy(quantized_model, test_set): num_labels=37, ignore_mismatched_sizes=True, revision="b3428f18dcc7b543470d07f14b4a4157815d1880", + use_safetensors=True, ).eval() image_preprocessor = AutoImageProcessor.from_pretrained( "facebook/deit-tiny-patch16-224",