# INVALID\_HANDEL Using Python API

**URL:** <https://community.stereolabs.com/t/invalid-handel-using-python-api/528>\
**Category:** Uncategorized\
**Created:** [October 3, 2021, 12:37pm UTC](https://community.stereolabs.com/t/invalid-handel-using-python-api/528 "2021-10-03T12:37:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuvalg1987](https://community.stereolabs.com/user_avatar/community.stereolabs.com/yuvalg1987/32/221_2.png) [@yuvalg1987](https://community.stereolabs.com/u/yuvalg1987)\
**Post date:** [October 3, 2021, 12:37pm UTC](https://community.stereolabs.com/t/invalid-handel-using-python-api/528/1 "2021-10-03T12:37:36Z")

</div>

Hi,

I’m trying to process images coming from the ZED camera using CuPy (A GPU equivalent to NumPy). I’m currently getting an INVALID\_HANDLE error that I cannot seem to overcome. reading some github threads it seems to be related to the context switching between ZED and CuPy. Does anybody have any idea how to solve this?

Thanks  
Yuval

---

<div class="post-metadata">

**Author:** ![yuvalg1987](https://community.stereolabs.com/user_avatar/community.stereolabs.com/yuvalg1987/32/221_2.png) [@yuvalg1987](https://community.stereolabs.com/u/yuvalg1987)\
**Post date:** [October 4, 2021, 1:23pm UTC](https://community.stereolabs.com/t/invalid-handel-using-python-api/528/2 "2021-10-04T13:23:47Z")

</div>

Just to update on my solution for this issue. The ZED runs its own context internally and therefore processing images using CuPy should be handled in a different thread. My best solution relied on the ZED-TensorFlow example which worked pretty good.
