Skip to content

Commit

Permalink
fix accuracy validation for bit test (#2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored May 15, 2024
1 parent df9fd4e commit ac80876
Showing 1 changed file with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -48,13 +49,13 @@
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin' and python_version <= '3.8'\"\n",
"\n",
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" \"tensorflow-hub>=0.15.0\" \"tensorflow_datasets\" tf_keras\n",
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" \"tensorflow-hub>=0.15.0\" tf_keras\n",
"%pip install -q \"scikit-learn>=1.3.2\"\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
" %pip install -q \"matplotlib>=3.4\" \"tensorflow_datasets>=4.9.0\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\""
" %pip install -q \"matplotlib>=3.4,<3.7\" \"tensorflow_datasets>=4.9.0<4.9.3\""
]
},
{
Expand Down Expand Up @@ -137,6 +138,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -219,6 +221,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -311,6 +314,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -322,10 +326,10 @@
"cell_type": "code",
"execution_count": 9,
"metadata": {
"test_replace": {
"test_replace": {
"train_dataset.take(3000)": "train_dataset.take(30)",
"validation_data=validation_dataset.take(1000)": "validation_data=validation_dataset.take(10)"
}
}
},
"outputs": [
{
Expand Down Expand Up @@ -361,6 +365,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -392,6 +397,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -403,8 +409,10 @@
"cell_type": "code",
"execution_count": 11,
"metadata": {
"test_replace": {"for _, label in validation_dataset:": "for _, label in validation_dataset.take(2):",
"for img_batch, label_batch in validation_dataset:": "for img_batch, label_batch in validation_dataset.take(2):"}
"test_replace": {
"for _, label in validation_dataset:": "for _, label in validation_dataset.take(2):",
"for img_batch, label_batch in validation_dataset:": "for img_batch, label_batch in validation_dataset.take(2):"
}
},
"outputs": [
{
Expand Down Expand Up @@ -443,6 +451,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -476,7 +485,9 @@
"cell_type": "code",
"execution_count": 12,
"metadata": {
"test_replace": {"for img_batch, _ in validation_dataset:": "for img_batch, _ in validation_dataset.take(2):"}
"test_replace": {
"for img_batch, _ in validation_dataset:": "for img_batch, _ in validation_dataset.take(2):"
}
},
"outputs": [],
"source": [
Expand All @@ -500,6 +511,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -517,9 +529,11 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {"test_replace": {
"metadata": {
"test_replace": {
"ov_int8_model = nncf.quantize(ov_fp32_model, calibration_dataset, fast_bias_correction=False)": "ov_int8_model = nncf.quantize(ov_fp32_model, calibration_dataset, fast_bias_correction=False, subset_size=10)"
}},
}
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -616,6 +630,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -626,7 +641,11 @@
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"metadata": {
"test_replace": {
"for img_batch, _ in validation_dataset:": "for img_batch, _ in validation_dataset.take(2):"
}
},
"outputs": [],
"source": [
"nncf_quantized_model = core.read_model(\"./bit_ov_int8_model/bit_m_r50x1_1_ov_int8.xml\")\n",
Expand All @@ -652,6 +671,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -684,6 +704,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down

0 comments on commit ac80876

Please sign in to comment.