Tensorflow 1.5 built with AVX support

TL;DR – download tensorflow 1.5 with AVX support from the link on the bottom of this post

When running machine learning code on a new hardware using libraries available on PIP we are not using all capabilities provided by our cpu:
2018-01-10 09:35:05.048387: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Last night I’ve rebuilt the tensorflow to support AVX CPU instructions. The set up for build takes about an hour. The build itself took 2 hours 20 minutes on my i7-8700k desktop with Windows 10 and hit the computer quite hard.

I’ve used official build manual (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/cmake/README.md), but it doesn’t mention all requirements:
* you need to install numpy in the environment you use for build
* you need to install wheel in the environment you use for build (otherwise it fails after 2 hours of build – sweet)
* if building against cuda9.1 you need to copy math_functions.h from cuda91/include/crt/ to cuda91/include directory (otherwise it fails after 1h of build)

The results?
Sample program without AVX:
start: 2018-01-10 09:35:04.609053
finish:2018-01-10 09:36:00.339329

total: ~55.5s

The same code with AVX:
start: 2018-01-10 09:36:18.167291
finish:2018-01-10 09:36:55.693329

total: ~37.5s

Here is the wheel file with support for AVX tensorflow_gpu-1.5.0rc0-cp36-cp36m-win_amd64.whl if you don’t want to run the build process itself.

And CPU usage during build (I got a new computer yesterday and I’m still excited by new toy :))


Geek way of buying silver wedding rings

Disclaimers: 1. this post mentions my shop. 2. I’m sure we offer a great deal!

If you are looking preparing for a wedding and you want to keep it real (i.e. don’t want to copy celebrities in their race for overspending) then consider buying Silver Wedding Rings instead of gold. Here’s why:

* you want your rign to carry the emotional value not a metal value. The emotions are the same with any symbol and the hard cash saved makes a lot of difference.
* Good quality sterling silver bands start at about £35, so you can get a pair for £70. Poor quality gold rings (9ct, made in China) will cost you at least £199, so rounhly £400 per pair. If you want a good quality gold bands it then you’re looking at at least £360 per piece bringing the total to £700 – ten times the price of silver ones!
* adding a small diamond to you silver ring will make it more unique and personal. Silver with diamond ring will cost you about £85 – example is here here.
* taking the jewellery on holidays is safe. We have a lot of customers buying “replacement rings” when they travel, because they are scared to take something too expensive. Do you really want to spend time worrying about a wedding ring?

And now a plug why it’s good to buy from Harry Fay:
* we will help you make sure your ring fits nicely. We offer free ring sizers and free exchange if the ring doesn’t fit.
* we can engrave your message inside your ring – for additional £10 we will write your message.
* we know what we do – our family is making and selling jewellery since 1991.

Please go to our website to learn more and check our offering of Silver wedding bands.


Adding wildcards to Google AIY actions on Raspberry Pi.

I’ve been playing with Google AIY on raspberry pi for nearly an hour now and I love it. If you are lucky you can get your kit from issue 57 of The MagPi Magazine.

Google provided a python based example app that recognises the command you spoke to the box and runs your action. The problem with it is that the command needs to match literally without and option to add variable part (a parameter). In real world I want to give parameters to the commands, for example “Add note my note“. So I’ve hacked the app to do just that. Here are the steps:
1. Modify the actionbase.py to recognize patterns. In class class KeywordHandler(object): change the handle method:

class KeywordHandler(object):

    """Perform the action when the given keyword is in the command."""

    def __init__(self, keyword, action):
        self.keyword = keyword.lower()
        self.action = action

    def get_phrases(self):
        return [self.keyword]

    def handle(self, command):
        if("*" in self.keyword):
            match = re.match(self.keyword.lower(), command.lower())
            if match:
                return True
            if self.keyword in command.lower():
                return True
                return False

2. Make sure the action you are running understands that the param given to it is the variable part. I’ve modified the SpeakAction to do just that:

class SpeakAction(object):

    """Says the given text via TTS."""

    def __init__(self, say, words):
        self.say = say
        self.words = words

    def run(self, voice_command):

3. Add new action in make_actor method:

    actor.add_keyword(_('add note (.*)'),SpeakAction(say,"adding $1"))

Have fun!


I’m not happy with Virgin Hub 3.0 (BT Hub 4 is much better)


For last two months I’ve been using Virgin Media Hub 3.0 and I haven’t found a single think to like about it. Part of it is that Virgin Media internet isn’t as good as promised – 200Mbps link gives this speed only during benchmarks to VM servers. Real world speeds usually hover around 20Mbps with up to 50-60Mbps when using multiple sources – for tasks like downloading CentOS images (I’ve testes many, many mirrors).

The things I do not like about the VM hub are:

  • DHCP cache is reset every restart, so my systems get different IPs from time to time (BT Hub remembered all system correctly)
  • UPnP doesn’t work. It is enabled, but I haven’t found any application that was able to set up port forwarding correctly
  • Using the admin panel is pain in the back – (login screen the admin panel takes 13 seconds to load, main screen takes about 22 seconds to display!) – see screenshots.



  • WiFi range seems to be less than average. I get the best coverage upstairs when the router is laying on a side.

I’m going to set the VM router into modem only mode and I’ll use BT Hub as my router instead.


Should I buy wireless headphones?

Well… no.


I really wanted to have wireless headphones for running and gym visits, so I got myself a pair of Skull Candy SMOKIN’ BUDS 2 WIRELESS. Those headphones sound good enough for exercise – on par with in-ear headphones I used so far (Sony from Xperia Z and Z3 and Skull Candy buds).

But I’m not happy with the purchase. Here’s why:

  • The wireless headphones need charging. I’ve already run out of power once in the gym. And even if you have power the headphones tell you they need  charging soon by… beeping. Beep… beep… beep… every few seconds. Try to concentrate with that in your ears.
  • The headphones are not wireless. There’s no wire to connect to the phone, but there’s quite a lot of wire connecting the in-ear buds. And this wire is more annoying that a standard cable, because it’s not attached to a fixed point, so it bounces around neck. And it has a sizeable bit of plastic in the middle. Skull Candy tried to patch this by adding a quite heavy rubbery neck bundle. Which stills bounces a bit and is no less irritating.
  • Android 6 cannot reliable handle BT audio. I’m using BT audio in my car, with Sony SRS-X55 speaker and with those headphones. Switching between Sony speaker, car and SB2 sometimes confuses Android. I had to go to BT settings to remove the connection and reconnect the phone again to all those devices several times. It doesn’t always help – I had to restart my phone three times as well. Which is not what I want to be doing in gym’s changing room!
  • BT range is good in theory, but seems to have gaps. Maybe my phone (Xperia z3) has a directional antenna or maybe it’s the headphones. I can leave the phone 3 to 5 meters from me and the sound is working well, but as soon as I slip the phone into my pocket the sounds starts to break. Not much, but I’m getting very short breaks every few steps – just like my body is blocking the signal.

Would I buy different headphones instead of SB2? No. The whole approach is broken and the whole ecosystem needs updating. I’ll try again in 3 years.


Setting up LBC podcast in BeyondPod

LBC offers paid podcasts and BeyondPod supports authentication, but not the one http://lbc.audioagain.com/ uses. The typical link to feed advertised on the website looks like this:


But there’s also a “hidden” link that accepts HTTP auth:


And the second one works well in BeyondPod.