Keras: plot_model returns pydot and graphviz related error on Windows

plot_model of Keras installed on Windows may return pydot and graphviz related error like “Graphviz’s executables are not found’. The error cause is that the computer does not know the path of Graphviz’s executable exactly mentioned as the error message. The solution is explained here.

  1. Install GraphViz software not python module
  2. add GraphViz’s bin directory to system path
  3. install graphviz like conda install graphviz
  4. install pydot like pip install git+https://github.com/nlhepler/pydot.git



TensorFlow’s DLL import error on windows

We need the appropriate cuDNN and this kind of import error occurred by missing the right version.

See this release note. TensorFlow 1.3.0 (and other prebuilt binaries) have been built with cuDNN 6 and TensorFlow 1.4 with cuDNN 7.

cuDNN installer are downloadable from here. On 2017.08.30, they provide the following versions.

  • cuDNN 7.0 for CUDA 9.0 RC
  • cuDNN 7.0 for CUDA 8.0
  • cuDNN 6.0 for CUDA 8.0
  • cuDNN 6.0 for CUDA 7.5
  • cuDNN 5.1 for CUDA 8.0
  • cuDNN 5.1 for CUDA 7.5

install keras + tensorflow (GPU) to Windows using anaconda

  1. Install Tensorflow and Keras
    1. Run Anaconda Prompt
    2. Install Tensorflow
      # pip install tensorflow-gpu
    3. Install Keras
      # pip install keras
  2. (Optional) Change Keras’ backend from Theano to TensorFlow
    1. This step is optional if Keras uses Theano as its backend.
    2. Start python and import keras
      # python
      # import keras
    3. If Theano is set as the backend, the terminal says “Using Theano backend
    4. Find the setting file location
      1. Find the location of Keras’ setting file. Executing the following 2 lines, the terminal shows the location where the Keras’ setting file is stored.
        # import os
        # print(os.path.expanduser(‘~’))
        NAME_OF_DIRECTORY (in my case it’s C:\User\USERNAME)
    5. Change the backend
      1. Open NAME_OF_DIRECTORY.keras\keras.json
      2. Change  “th” to “tf
      3. Change “theano” to “tensorflow
  3. run any Keras example

Visual Studio 2015 with CMake

right after you installed visual studio 2015, CMake cannot find C and C++ compiler of it because Visual Studio 2015 installer didn’t install any compiler. Although I have no ideas this is due to default or my install setting, I found the solution.

Open Visual Studio 2015 and create a new project using C or C++ so that FXXX Visual Studio asks you whether you install the compiler or not.