diff --git a/samples/python/benchmark/bert_benchmark/bert_benchmark.py b/samples/python/benchmark/bert_benchmark/bert_benchmark.py index b15bbd48b34c84..f81eac29387182 100755 --- a/samples/python/benchmark/bert_benchmark/bert_benchmark.py +++ b/samples/python/benchmark/bert_benchmark/bert_benchmark.py @@ -57,7 +57,7 @@ def main(): sst2_sentences = sst2['validation']['sentence'] # Warm up encoded_warm_up = dict(tokenizer('Warm up sentence is here.', return_tensors='np')) - for _ in ireqs: + for _ in range(len(ireqs)): ireqs.start_async(encoded_warm_up) ireqs.wait_all() # Benchmark diff --git a/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py b/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py index 0573642fb2fdaa..ce9431e3e5121d 100755 --- a/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py +++ b/samples/python/benchmark/throughput_benchmark/throughput_benchmark.py @@ -52,7 +52,7 @@ def main(): for model_input in compiled_model.inputs: fill_tensor_random(ireq.get_tensor(model_input)) # Warm up - for _ in ireqs: + for _ in range(len(ireqs)): ireqs.start_async() ireqs.wait_all() # Benchmark for seconds_to_run seconds and at least niter iterations