# ResNet optimization with PTQ on CPU This is a sample use case of olive to optimize a ResNet model using onnx conversion and onnx dynamic/static quantization tuner. ## Prerequisites Please go to example repository [Quickstart ResNet Example](https://github.com/microsoft/Olive/tree/main/examples/resnet_ptq_cpu) ### Prepare data and model To Prepare the model and necessary data: ``` python prepare_model_data.py --num_epochs 5 ``` ### Pip requirements Install the necessary python packages: ``` python -m pip install -r requirements.txt ``` ## Run sample using config ``` python -m olive.workflows.run --config resnet_{dynamic,static}_config.json ``` or run simply with python code: ```python from olive.workflows import run as olive_run olive_run("resnet_dynamic_config.json") olive_run("resnet_static_config.json") ```