I’ve followed the instructions on setting up the new tensorflow component but have run into an issue. I compiled the models exactly as the instructions (on the host machine) and copied all the files into the mounted config folder. but unfortunately keep getting the following error which stops HA starting.
The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
Could this be to do with the models being compiled outside the docker image, even though its the same architecture?
I’m getting the same sort of error:
The TensorFlow library was compiled to use SSE4.1 instructions, but these aren’t available on your machine.
Except for SSE4.1
I’m using a Proxmox Hypervisor with a Intel Core i3 processor(with HT).
So i’ve build the Docker image on my host machine, and I still have the same error.
I even switched to the Dev branch and rebuild the image, but still the same error.
If I do a docker exec, and install tensorflow i don’t get the error. But Hass won’t start.
And restarted home assistant (not docker) with the tensorflow config in, home assistant starts now. But in the log I get the following error :
No TensorFlow Object Detection library found! Install or compile for your system following instructions here: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md
pip worked, uninstalled the old tensorflow and added the new one from the file so I’m not sure where to go from here.
I messed with this yesterday and it appears to be working, if a bit slow. I use a Synology NAS, which also fails on the default install due to the lack of AVX instruction sets.
2018-11-13 23:16:38 WARNING (MainThread) [homeassistant.helpers.entity] Update of image_processing.tensorflow_motion_frontdoor is taking over 10 seconds
2018-11-13 23:17:13 INFO (SyncWorker_14) [homeassistant.components.image_processing.tensorflow] Saving results image to /storagemotion/tensorflow/motion_frontdoor_latest.jpg
2018-11-13 23:17:13 INFO (SyncWorker_14) [homeassistant.components.image_processing.tensorflow] Saving results image to /storagemotion/tensorflow/motion_frontdoor_20181114_091713.jpg
Here is the result (red box is from Motion, yellow box plus person label is from tensorflow)
Logs show stuff taking awhile at startup;
2018-11-13 23:15:04 WARNING (SyncWorker_18) [homeassistant.components.image_processing.tensorflow] No OpenCV library found. TensorFlow will process image with PIL at reduced resolution.
2018-11-13 23:15:11 WARNING (MainThread) [homeassistant.components.image_processing] Setup of platform tensorflow is taking over 10 seconds.
So i’m pleased with the result but need a big performance boost before it would be usable
45 seconds?! Gulp, I was wondering what the frame rate would be, but that’s surprising. If the idea is to use a pi, then I would suggest offloading to a compute stick and running the models through the VPU
@cwjackson yep, i followed that gist and then chose a model that seemed faster on low powered hardware (ssd_mobilenet_v2_coco)
I’d be very interested to see what sort of speeds other people are getting. My NAS is pretty busy though, might try today with CPU hungry tasks stopped and see if speed improves.
I’ve installed OpenCV within the container as well, to see if that improves things. Speed was about the same but the error referencing opencv no longer occurs.
With my Motion container stop (which uses pretty high CPU), tensorflow catagorises People only correctly in 3-5 seconds - much better!
With the catagories section commented out, i’m averaging 7-9 seconds.
If anyone wants a tensorflow wheel compiled for a synology 918+ let me know and i can save you the compile time.
These examples are from oldish hikvisions, with tensorflow analysing the low quality version of the images (640x480 i think). I’d imagine the accuracy would be increased if the source was better quality but it does seem to work well with low quality images.
I’ve just tried this config change and we picked up a car nicely with very high accuracy
model:
graph: /config/tensorflow/ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.pb
categories:
- person
- car
- cat
- dog
- bird
Pretty pleased, some clever people out there building these integrations!
@M203 Send me a photo if you like and i can see what tensorflow would pick up from it, see if your source would be good enough?
I’ve not been able to get this working reliably though and its definitely not stable.
@M203 i tried processing those test images you sent me and HA crashes immediately. I then switched back to my previous images and the docker container crashes immediately after i try to process an image.
I put HA into debug mode but cannot generate a crash log or anything like that, this is the last line in the logs.
2018-11-16 09:16:44 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=image_processing, service=scan, service_data=entity_id=image_processing.tensorflow_motion_front, service_call_id=e0b992c7222c4c19a25b9e7e0adc6c6b>
2018-11-16 09:16:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of image_processing.tensorflow_motion_front is taking over 10 seconds