# Python Webcam Inference Examples not working

**URL:** <https://discuss.roboflow.com/t/python-webcam-inference-examples-not-working/1140>\
**Category:** 🤝  Community Help\
**Created:** [November 29, 2022, 3:05pm UTC](https://discuss.roboflow.com/t/python-webcam-inference-examples-not-working/1140 "2022-11-29T15:05:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Malche](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/timothy_malche/32/745_2.png) [@Timothy\_Malche](https://discuss.roboflow.com/u/Timothy_Malche)\
**Post date:** [November 29, 2022, 3:05pm UTC](https://discuss.roboflow.com/t/python-webcam-inference-examples-not-working/1140/1 "2022-11-29T15:05:34Z")

</div>

I am trying example [**infer-simple.py**](https://github.com/roboflow-ai/roboflow-api-snippets/blob/main/Python/webcam/infer-simple.py) and I am getting following error:

```auto
C:\Users\timothym\mycode>python infer-simple.py
Traceback (most recent call last):
  File "C:\Users\timothym\mycode\infer-simple.py", line 70, in <module>
    cv2.imshow('image', image)
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

```

what is the problem.

---

<div class="post-metadata">

**Author:** ![Timothy\_Malche](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/timothy_malche/32/745_2.png) [@Timothy\_Malche](https://discuss.roboflow.com/u/Timothy_Malche)\
**Post date:** [November 29, 2022, 3:57pm UTC](https://discuss.roboflow.com/t/python-webcam-inference-examples-not-working/1140/2 "2022-11-29T15:57:45Z")

</div>

I just found the solution from [this](https://discuss.roboflow.com/t/webcam-inference-does-not-work-with-jetson-nano-inference-server/275/3) thread. I just specified model-name and model-version in the JSON file and it worked.

`"ROBOFLOW_MODEL": "my-model/2",`

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [November 29, 2022, 8:53pm UTC](https://discuss.roboflow.com/t/python-webcam-inference-examples-not-working/1140/3 "2022-11-29T20:53:37Z")

</div>

Awesome!

There’s another Roboflow GitHub repo with example code for this too:

1. [roboflow-computer-vision-utilities/webcam\_od.py at main · roboflow-ai/roboflow-computer-vision-utilities · GitHub](https://github.com/roboflow-ai/roboflow-computer-vision-utilities/blob/main/webcam/webcam_od.py)
2. config file: [roboflow-computer-vision-utilities/roboflow\_config.json at main · roboflow-ai/roboflow-computer-vision-utilities · GitHub](https://github.com/roboflow-ai/roboflow-computer-vision-utilities/blob/main/roboflow_config.json)
