Allow soft placement in tensorflow
This error probably occurs because you are using python 2.7. Where as tensorflow is for use with python 3.5 and python 3.6
I just upgraded from tf 1.1 to tf 1.4 for python 2.7 and I got the following problem: 
I have a graph which I am putting all its OPs in the specific device by using tf.device('device') command. But, one of the OPs is only allowed to be in CPU device, so I am using allow_soft_placement=True and it was working correctly in tf 1.1 (it put only the OPs without GPU implementation in CPU and other OPs in GPU). But now (in tf1.4) when I am running my network it is putting all the OPs in the CPU (not just the one which has not GPU implementation). 
Any help is appreciated.