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

Fix results validation #20246

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,8 @@ jobs:

- name: Install PyTorch tests requirements
run: |
python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/torch_tests/requirements.txt
python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/torch_tests/requirements_secondary.txt
echo "Available storage:"
df -h
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def infer_ov_model(self, ov_model, inputs, ie_device):

def compare_results(self, fw_outputs, ov_outputs):
assert len(fw_outputs) == len(ov_outputs), \
"Different number of outputs between TensorFlow and OpenVINO:" \
"Different number of outputs between framework and OpenVINO:" \
" {} vs. {}".format(len(fw_outputs), len(ov_outputs))

fw_eps = 5e-2
Expand All @@ -73,13 +73,13 @@ def compare_results(self, fw_outputs, ov_outputs):
"OpenVINO outputs does not contain tensor with name {}".format(out_name)
cur_ov_res = ov_outputs[out_name]
print(f"fw_re: {cur_fw_res};\n ov_res: {cur_ov_res}")
is_ok = compare_two_tensors(cur_ov_res, cur_fw_res, fw_eps)
is_ok = is_ok and compare_two_tensors(cur_ov_res, cur_fw_res, fw_eps)
else:
for i in range(len(ov_outputs)):
cur_fw_res = fw_outputs[i]
cur_ov_res = ov_outputs[i]
print(f"fw_res: {cur_fw_res};\n ov_res: {cur_ov_res}")
is_ok = compare_two_tensors(cur_ov_res, cur_fw_res, fw_eps)
is_ok = is_ok and compare_two_tensors(cur_ov_res, cur_fw_res, fw_eps)
assert is_ok, "Accuracy validation failed"

def teardown_method(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/model_hub_tests/torch_tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ sacremoses
sentencepiece
datasets
pyctcdecode
pytorch-quantization<=2.1.3 --extra-index-url https://pypi.ngc.nvidia.com
protobuf
soundfile
pandas
git+https://github.com/facebookresearch/detectron2.git@1a4df4d954089534daebbd7a0a45f08ece87056e
natten
5 changes: 0 additions & 5 deletions tests/model_hub_tests/torch_tests/requirements_secondary.txt

This file was deleted.