Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MobileViT-XS to MCT-model garden #1049

Merged
merged 5 commits into from
May 2, 2024
Merged

Conversation

lapid92
Copy link
Contributor

@lapid92 lapid92 commented Apr 24, 2024

Pull Request Description:

Add MobileViT-XS to MCT-model garden
Add MobileViT-XS tutorial

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

Copy link
Collaborator

@Idan-BenAmi Idan-BenAmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comments

"!rm -f imagenet/val/ILSVRC2012_img_val.tar\n",
"# We follow https://github.com/pytorch/examples/blob/main/imagenet/extract_ILSVRC.sh here\n",
"# get script from soumith and run; this script creates all class directories and moves images into corresponding directories\n",
"!cd imagenet/val/ && wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"\n",
"### Download a Pre-Trained Model \n",
"\n",
"We begin by loading a pre-trained [MobileViT-XS](https://huggingface.co/SSI-DNN/pytorch_mobilevit_xs) model. This implementation is based on [Timm](https://github.com/huggingface/pytorch-image-models) and includes a slightly modified version of timm/Attention module that was adapted for model quantization. For further insights into the model's implementation details, please refer to [MCT Models Garden - yolov8](https://github.com/sony/model_optimization/tree/main/tutorials/mct_model_garden/models_pytorch/mobilevit_xs). "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a few words what are the adjustments (batch issue..)

" target_platform_version='v1')\n",
"\n",
"# Specify the necessary configuration for mixed precision quantization. To keep the tutorial brief, we'll use a small set of images and omit the hessian metric for mixed precision calculations. It's important to be aware that this choice may impact the resulting accuracy. \n",
"mp_config = mct.core.MixedPrecisionQuantizationConfig(num_of_images=5,\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if compression is required..

@lapid92 lapid92 merged commit 805c14f into sony:main May 2, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants