tensorflow gpu install window error : self_check.py...ImportError: Could not find 'cudnn64_6.dll...


hmm......I have taken for about 5 hours for solve this problem....

error is like that:

Traceback (most recent call last):
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\site-packages\tensorflow\python\platform\self_check.py", line 87, in preload_check
    ctypes.WinDLL(build_info.cudnn_dll_name)
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 지정된 모듈을 찾을 수 없습니다
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
  File "C:\Users\mare\Anaconda3\envs\mare4\lib\site-packages\tensorflow\python\platform\self_check.py", line 97, in preload_check
    % (build_info.cudnn_dll_name, build_info.cudnn_version_number))
ImportError: Could not find 'cudnn64_6.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 6 from this URL: https://developer.nvidia.com/cudnn

In conclusion..
just use cudnn 6.0, that is Download cuDNN v6.0 (April 27, 2017), for CUDA 8.0

I have tried many time
cuda 9.1 + cudnn 7.x
cuda 8.0 + cudnn 7.x
...
but I never successed

tensorflow official site recommend
cuda 8.0 + cudnn 6.1
https://www.tensorflow.org/install/install_windows
I just ignore this mention, because you know I thought the document is outdated.



This is simple tutorial for install tensorflow-gpu in window.

1. install anaconda.

conda create -n tensorflow python=3.5 

2. install cuda 8.0 and cudnn 6.x

move cudnn header, lib and dll to cuda 8.0 folder
http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installwindows

3. install tensorflow-gpu

pip install --ignore-installed --upgrade tensorflow-gpu 

4. check tensorflow-gpu

>>> import tensorflow as tf
>>> tf.test.is_built_with_cuda()
Ture






django + mysql setting (Mac or Linux)

A. mysql install

1. download mysql

https://dev.mysql.com/downloads/mysql/



* site may ask to join, but we don't need to join for download file
* install -> in case of Mac, show default password on popup window.

2. set path

$nano ~/.bash_profile 
add this sentence 

#mysql
export PATH=/usr/local/mysql/bin:$PATH

3. start mysql & set password

$ sudo /usr/local/mysql/support-files/mysql.server start

create a username with a password
$ mysqladmin -u root&nbsp;password yourpassword
or
change the password
$ mysqladmin -u root -p'oldpassword' password newpassword

4. create mysql database

login
$ mysql -u root -p
Enter password:

create database
CREATE DATABASE taskbuster_db;



B. django setting

1. install pymysql

$pip install pymysql

2. django settings.py

import pymysql
pymysql.install_as_MySQLdb()

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',        
'NAME': 'django_locker', # DB name        
'USER': '', # database user : root        
'PASSWORD': '', # database pass         
'HOST': '', # localhost        
'PORT': '', # database port('' or 3306)    }
}


3. migration

$python manage.py makemigrations

$python manage.py migrate



Anaconda simple command


version check
$ conda -V 
conda 3.7.0

update
conda update conda

create virtual env
conda create -n yourenvname python=x.x anaconda

activate
source activate yourenvname

install additional python packages
conda install -n yourenvname [package]

deactivate
source deactivate

remove virtual env
conda remove -n yourenvname --all

show all virtual env list
conda info --envs
or
conda env list

anaconda uninstall
conda install anaconda-clean   # install the package anaconda clean
anaconda-clean --yes           # clean all anaconda related files and directories
rm -rf ~/anaconda3             # removes the entire anaconda directory
#rm -rf /user/username/anaconda3 or rm -rf /Users/username/anaconda3

rm -rf ~/.anaconda_backup       # anaconda clean creates a back_up of files/dirs, remove it    
                            # (conda list; cmd shouldn't respond after the clean up)

minianaconda install
bash Miniconda3-latest-MacOSX-x86_64.sh
https://conda.io/docs/user-guide/install/macos.html#install-macos-silent