Image Classification (ResNet, ViT, MobileNet, ...)
Collection
524 items
•
Updated
•
3
Frequently Asked Questions
model/smash_config.json
and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.You can run the smashed model with these steps:
nvcc --version
and install with conda install nvidia/label/cuda-12.1.0::cuda
.pruna-engine
available here on Pypi. It might take up to 15 minutes to install.pip install pruna-engine[gpu]==0.7.1 --extra-index-url https://pypi.nvidia.com --extra-index-url https://pypi.ngc.nvidia.com --extra-index-url https://prunaai.pythonanywhere.com/
mkdir vit_base_patch16_224_miil.in21k-turbo-tiny-green-smashed
huggingface-cli download PrunaAI/vit_base_patch16_224_miil.in21k-turbo-tiny-green-smashed --local-dir vit_base_patch16_224_miil.in21k-turbo-tiny-green-smashed --local-dir-use-symlinks False
import subprocess
repo_name = "vit_base_patch16_224_miil.in21k-turbo-tiny-green-smashed"
subprocess.run(["mkdir", repo_name])
subprocess.run(["huggingface-cli", "download", 'PrunaAI/'+ repo_name, "--local-dir", repo_name, "--local-dir-use-symlinks", "False"])
from pruna_engine.PrunaModel import PrunaModel
model_path = "vit_base_patch16_224_miil.in21k-turbo-tiny-green-smashed/model" # Specify the downloaded model path.
smashed_model = PrunaModel.load_model(model_path) # Load the model.
import torch; image = torch.rand(1, 3, 224, 224).to('cuda')
smashed_model(image)
The configuration info are in model/smash_config.json
.
The license of the smashed model follows the license of the original model. Please check the license of the original model vit_base_patch16_224_miil.in21k before using this model which provided the base model. The license of the pruna-engine
is here on Pypi.