hunterjm / hassio-addons

Control your Xbox One from your Home Assistant device.
MIT License
55 stars 50 forks source link

Tensorflow no longer works #49

Closed warwickbuilds closed 4 years ago

warwickbuilds commented 4 years ago

latest few versions (95/96) of Hass.io look to have broken the tensor flow add-on, still installs ok, but calling the service errors. Any ideas

Add-on Log after start (looks normal)

[Info] Install TensorFlow modules into deps Requirement already satisfied: absl-py==0.1.6 in /config/deps/lib/python3.7/site-packages (0.1.6) Requirement already satisfied: astor==0.7.1 in /config/deps/lib/python3.7/site-packages (0.7.1) Requirement already satisfied: termcolor==1.1.0 in /config/deps/lib/python3.7/site-packages (1.1.0) Requirement already satisfied: gast==0.2.0 in /config/deps/lib/python3.7/site-packages (0.2.0) Requirement already satisfied: keras_applications==1.0.6 in /config/deps/lib/python3.7/site-packages (1.0.6) Requirement already satisfied: keras_preprocessing==1.0.5 in /config/deps/lib/python3.7/site-packages (1.0.5) You are using pip version 19.0.2, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [Info] Install TensorFlow into deps Requirement already satisfied: tensorflow==1.13.0rc2 from file:///tensorflow-1.13.0rc2-cp37-cp37m-linux_x86_64.whl in /config/deps/lib/python3.7/site-packages (1.13.0rc2) You are using pip version 19.0.2, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [INFO] TensorFlow installed and ready for use

Error in hassio logs after calling tensorflow service

Log Details (ERROR) Thu Jul 18 2019 22:15:48 GMT+0930 (Australian Central Standard Time) Update for image_processing.tensorflow_hikvisionfrontdoor fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/tensorflow/image_processing.py", line 258, in process_image import cv2 # pylint: disable=import-error ModuleNotFoundError: No module named 'cv2' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 378, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 132, 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 "/usr/src/homeassistant/homeassistant/components/tensorflow/image_processing.py", line 266, in process_image img = Image.open(io.BytesIO(bytearray(image))).convert('RGB') File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2687, in open % (filename if filename else fp)) OSError: cannot identify image file <_io.BytesIO object at 0x7f6a9a657e90>

this is the service config

image_processing:

`` - platform: tensorflow
   source:
     - entity_id: camera.hikvisionfrontdoor
     - entity_id: camera.foscamgarage
   file_out:
    - "/config/www/imageprocessingoutput/{{ camera_entity.split('.')[1] }}_latest.jpg"
    - "/config/www/imageprocessingoutput/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"
   scan_interval: 604800
   model:
     graph: /config/tensorflow/model/frozen_inference_graph.pb
     categories:
      - person
warwickbuilds commented 4 years ago

Closing as no longer utilize, awesome capability whilst it worked for me! thanks again for sharing.