Skip to content

Commit 9f44168

Browse files
cancel all inf_requests
1 parent 24b143e commit 9f44168

File tree

1 file changed

+4
-2
lines changed
  • demos/action_recognition_demo/python/action_recognition_demo

1 file changed

+4
-2
lines changed

demos/action_recognition_demo/python/action_recognition_demo/steps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def __init__(self, encoder):
102102
self.async_model = AsyncWrapper(self.encoder, self.encoder.num_requests)
103103

104104
def __del__(self):
105-
self.encoder.infer_queue[0].cancel()
105+
for ireq in self.encoder.infer_queue:
106+
ireq.cancel()
106107

107108
def process(self, frame):
108109
preprocessed = preprocess_frame(frame)
@@ -125,7 +126,8 @@ def __init__(self, decoder, sequence_size=16):
125126
self._embeddings = deque(maxlen=self.sequence_size)
126127

127128
def __del__(self):
128-
self.decoder.infer_queue[0].cancel()
129+
for ireq in self.decoder.infer_queue:
130+
ireq.cancel()
129131

130132
def process(self, item):
131133
if item is None:

0 commit comments

Comments
 (0)