Anaconda: install OpenCV 3.4.1 on Windows 10

conda install … opencv, conda install … opencv-python ruined my environment built on Windows 10. The error seemed to related to PyQt and authentication/path setting but couldn’t specify the true cause.

So, instead of using anaconda binary, I tried unofficial windows binary and it worked 🙂 The required steps are
1. Go to the site
2. Download .whl file appropriate for your environment, say RIGHT_BINARY.whl (opencv_python‑3.4.1‑cp36‑cp36m‑win_amd64.whl in my case)
3. install by pip install RIGHT_BINARY.whl


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