|
1 | 1 | # `Intel® Neural Compressor TensorFlow* Getting Started*` Sample
|
2 | 2 |
|
3 |
| -The `Intel® Neural Compressor TensorFlow* Getting Started*` Sample demonstrates using the Intel® Neural Compressor, which is part of the Intel® AI Tools with the with Intel® Optimizations for TensorFlow* to speed up inference by simplifying the process of converting the FP32 model to INT8/BF16. |
| 3 | +This sample demonstrates using the Intel® Neural Compressor, which is part of the Intel® AI Tools with the with Intel® Optimizations for TensorFlow* to speed up inference by simplifying the process of converting the FP32 model to INT8/BF16. |
4 | 4 |
|
5 | 5 | | Property | Description
|
6 | 6 | |:--- |:---
|
@@ -74,11 +74,7 @@ The sample demonstrates how to:
|
74 | 74 | ## Environment Setup
|
75 | 75 | If you have already set up the PIP or Conda environment and installed AI Tools go directly to Run the Notebook.
|
76 | 76 |
|
77 |
| -### On Linux* (Only applicable to AI Tools Offline Installer) |
78 |
| - |
79 |
| -#### Set Environment Variables |
80 |
| - |
81 |
| -When working with the command-line interface (CLI), you should configure the oneAPI toolkits using environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries, and tools are ready for development. |
| 77 | +### On Linux* |
82 | 78 |
|
83 | 79 | #### Setup Conda Environment
|
84 | 80 |
|
@@ -143,45 +139,33 @@ Configure Conda for **user_tensorflow** by entering commands similar to the foll
|
143 | 139 |
|
144 | 140 | #### Configure Jupyter Notebook
|
145 | 141 |
|
146 |
| -1. Create a new kernel for the Jupyter notebook based on your activated conda environment. |
| 142 | +Create a new kernel for the Jupyter notebook based on your activated conda environment. |
147 | 143 | ```
|
148 | 144 | conda install ipykernel
|
149 | 145 | python -m ipykernel install --user --name usr_tensorflow
|
150 | 146 | ```
|
151 | 147 | This step is optional if you plan to open the notebook on your local server.
|
152 | 148 |
|
153 |
| -### On Windows* |
154 |
| -
|
155 |
| -#### Configure Conda |
156 |
| -
|
157 |
| -Configure Conda for **user_tensorflow** by entering commands similar to the following: |
158 |
| - ``` |
159 |
| - conda deactivate |
160 |
| - conda env remove -n user_tensorflow |
161 |
| - conda create -n user_tensorflow python=3.9 -y |
162 |
| - conda activate user_tensorflow |
163 |
| - conda install -n user_tensorflow pycocotools -c esri -y |
164 |
| - conda install -n user_tensorflow neural-compressor tensorflow -c conda-forge -c intel -y |
165 |
| - conda install -n user_tensorflow jupyter runipy notebook -y |
166 |
| - conda install -c anaconda ipykernel |
167 |
| - python -m ipykernel install --user --nam=user_tensorflow |
168 |
| - ``` |
169 |
| -
|
170 | 149 | ## Run the `Intel® Neural Compressor TensorFlow* Getting Started*` Sample
|
171 | 150 |
|
172 |
| -> **Note**: If you have not already done so, set up your CLI |
173 |
| -> environment by sourcing the `setvars` script in the root of your oneAPI installation. |
| 151 | +> **Note**: Before running the sample, make sure [Environment Setup](https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/INC-Sample-for-TensorFlow#environment-setup) is completed. |
174 | 152 | >
|
175 | 153 | > Linux*:
|
176 |
| -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` |
177 |
| -> - For private installations: ` . ~/intel/oneapi/setvars.sh` |
178 |
| -> - For non-POSIX shells, like csh, use the following command: `bash -c 'source <install-dir>/setvars.sh ; exec csh'` |
179 |
| -> |
180 |
| -> Windows*: |
181 |
| -> - `C:\Program Files (x86)\Intel\oneAPI\setvars.bat` |
182 |
| -> - Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` |
183 |
| -> |
184 |
| -> For more information on configuring environment variables, see *[Use the setvars Script with Linux* or macOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html)* or *[Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html)*. |
| 154 | +Go to the section which corresponds to the installation method chosen in [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to see relevant instructions: |
| 155 | +* [AI Tools Offline Installer (Validated)](#ai-tools-offline-installer-validated) |
| 156 | +* [Conda/PIP](#condapip) |
| 157 | +* [Docker](#docker) |
| 158 | +
|
| 159 | +### AI Tools Offline Installer (Validated) |
| 160 | +1. If you have not already done so, activate the AI Tools bundle base environment. |
| 161 | +If you used the default location to install AI Tools, open a terminal and type the following |
| 162 | +``` |
| 163 | +source $HOME/intel/oneapi/intelpython/bin/activate |
| 164 | +``` |
| 165 | +If you used a separate location, open a terminal and type the following |
| 166 | +``` |
| 167 | +source <custom_path>/bin/activate |
| 168 | +``` |
185 | 169 |
|
186 | 170 | ### Active Conda Environment
|
187 | 171 |
|
|
0 commit comments