← 输入框|github.com|刷新
Skip to content

Can be success = False but no error #16

Closed

Description

@robmarkcole

Reported on the forums by @Reneeetje:

2019-10-03 18:01:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.detectie_persoon_tpu_voordeur fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 439, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 136, in async_update
    await self.async_process_image(image.content)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/deepstack_object/image_processing.py", line 150, in process_image
    self._dsobject.detect(image)
  File "/usr/local/lib/python3.7/site-packages/deepstack/core.py", line 129, in detect
    error = response.json()["error"]
KeyError: 'error'

This occurs at:

        if response.status_code == HTTP_OK:
            if response.json()["success"]:
                self._predictions = response.json()["predictions"]
            else:
                error = response.json()["error"]
                raise DeepstackException(f"Error from Deepstack: {error}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions