Skip to content

Commit 90a9fe4

Browse files
authored
Merge pull request #2442 from Ankur-singh/fix/tf_getting_started
[release/2024.2_AITools] updated ITEX Getting Started sample
2 parents c9e0e86 + ae187d1 commit 90a9fe4

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted/ResNet50_Inference.ipynb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@
9696
}
9797
],
9898
"source": [
99-
"run ../../version_check.py"
99+
"import sys\n",
100+
"sys.path.append('../../')\n",
101+
"\n",
102+
"import version_check\n",
103+
"\n",
104+
"arch = version_check.arch_checker().arch\n",
105+
"print(\"Arch: \", arch)"
100106
]
101107
},
102108
{
@@ -123,8 +129,8 @@
123129
"source": [
124130
"%%writefile run.sh\n",
125131
"#!/bin/bash\n",
126-
"source $ONEAPI_INSTALL/setvars.sh --force > /dev/null 2>&1\n",
127-
"source activate user-tensorflow-gpu\n",
132+
"source /intel/oneapi/intelpython/bin/activate\n",
133+
"conda activate tensorflow-gpu\n",
128134
"echo \"########## Executing the run\"\n",
129135
"DNNL_VERBOSE=1 python infer_resnet50.py > infer_rn50_gpu.csv\n",
130136
"echo \"########## Done with the run\""
@@ -148,7 +154,7 @@
148154
"metadata": {},
149155
"outputs": [],
150156
"source": [
151-
"! chmod 755 ../../q; chmod 755 run.sh;if [ -x \"$(command -v qsub)\" ]; then ./q run.sh; else ./run.sh; fi"
157+
"!chmod 755 run.sh; ./run.sh;"
152158
]
153159
},
154160
{
@@ -167,8 +173,8 @@
167173
"source": [
168174
"%%writefile run.sh\n",
169175
"#!/bin/bash\n",
170-
"source $ONEAPI_INSTALL/setvars.sh --force > /dev/null 2>&1\n",
171-
"source activate user-tensorflow\n",
176+
"source /intel/oneapi/intelpython/bin/activate\n",
177+
"source activate tensorflow\n",
172178
"echo \"########## Executing the run\"\n",
173179
"DNNL_VERBOSE=1 python infer_resnet50.py > infer_rn50_cpu.csv\n",
174180
"echo \"########## Done with the run\""
@@ -192,7 +198,7 @@
192198
"metadata": {},
193199
"outputs": [],
194200
"source": [
195-
"! chmod 755 ../../q; chmod 755 run.sh;if [ -x \"$(command -v qsub)\" ]; then ./q run.sh; else ./run.sh; fi"
201+
"!chmod 755 run.sh; ./run.sh;"
196202
]
197203
},
198204
{

AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted/sample.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,20 @@
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate tensorflow",
18-
"pip install -r requirements.txt --no-deps",
18+
"pip install tensorflow_hub==0.16.0 matplotlib",
1919
"pip install tensorflow==2.15.0.post1",
2020
"pip install jupyter ipykernel",
2121
"python -m ipykernel install --user --name=tensorflow",
2222
"conda deactivate",
2323
"conda activate tensorflow-gpu",
24-
"pip install -r requirements.txt --no-deps",
24+
"pip install tensorflow_hub==0.16.0 matplotlib",
2525
"pip install tensorflow==2.15.0.post1",
26-
"pip install jupyter ipykernel",
27-
"python -m ipykernel install --user --name=tensorflow-gpu",
2826
"conda deactivate"
2927
],
3028
"id": "itex_sample_test",
3129
"steps": [
3230
"conda activate tensorflow",
33-
"jupyter nbconvert --to notebook --execute ResNet50_Inference.ipynb"
31+
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook ResNet50_Inference.ipynb"
3432
]
3533
}]
3634
},

0 commit comments

Comments
 (0)