This is based on https://www.youtube.com/watch?v=oxf3o8IbCk4 , AKA "TensorFlow 101 (Really Awesome Intro Into TensorFlow)". That video is a bit old. I've installed tensorflow 1.8.0, but the tutorial is about 1.2 - in a presentation from 2017. Even for this small program, tensorflow had changed too much to be compatible.