Change:
Traceback (most recent call last): File "", line 3, in <moduleimport model File "/home/abc/github/chinese-", line 5, in <modulefrom import crnnOcr File "/home/abc/github/chinese-", line 72, in <modulemodel,converter = crnnSource() File "/home/abc/github/chinese-", line 64, in crnnSource model = crnn.CRNN(32, 1, len(alphabet)+1, 256, 1).cuda() File "/usr/local/lib/python2.7/dist-", line 216, in cuda return (lambda t: t.cuda(device)) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 123, in apply self.flattenparameters() File "/usr/local/lib/python2.7/dist-", line 65, in flattenparameters if not or not (anyparam): File "/usr/local/lib/python2.7/dist-", line 82, in isacceptable if libcudnn() is None: File "/usr/local/lib/python2.7/dist-", line 58, in libcudnn 'but linked against {}'.format(compileversion, _cudnnversion)) RuntimeError: cuDNN version mismatch: PyTorch was compiled against 6021 but linked against 5110 How to solve the problem?
could you pull the latest master branch and recompile. I pushed a change yesterday that fixes this:
I remove the old code and pull new code, then compile, install.It still fails. /usr/local/lib/python2.7/dist- UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually. ('No training configuration found in save file: ' Traceback (most recent call last): File "", line 3, in <moduleimport model File "/home/qianbb/github/chinese-", line 5, in <modulefrom import crnnOcr File "/home/qianbb/github/chinese-", line 72, in <modulemodel,converter = crnnSource() File "/home/qianbb/github/chinese-", line 64, in crnnSource model = crnn.CRNN(32, 1, len(alphabet)+1, 256, 1).cuda() File "/usr/local/lib/python2.7/dist-", line 216, in cuda return (lambda t: t.cuda(device)) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 100, in apply self.flattenparameters() File "/usr/local/lib/python2.7/dist-", line 66, in flattenparameters if not or not (anyparam): File "/usr/local/lib/python2.7/dist-", line 87, in isacceptable if libcudnn() is None: File "/usr/local/lib/python2.7/dist-", line 58, in libcudnn 'but linked against {}'.format(compileversion, _cudnnversion)) RuntimeError: cuDNN version mismatch: PyTorch was compiled against 6021 but linked against 5110 The library of cuda is shown as following screenshot. !
I found the issue, I fixed it in which we will merge shortly.
ThanksDoes it have been merged?
yes. it is merged.
It seems the fix doesn't work. The log is shown as following Traceback (most recent call last): File "", line 3, in <moduleimport model File "/home/qianbb/github/chinese-", line 5, in <modulefrom import crnnOcr File "/home/qianbb/github/chinese-", line 72, in <modulemodel,converter = crnnSource() File "/home/qianbb/github/chinese-", line 64, in crnnSource model = crnn.CRNN(32, 1, len(alphabet)+1, 256, 1).cuda() File "/usr/local/lib/python2.7/dist-", line 222, in cuda return (lambda t: t.cuda(device)) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 146, in apply (fn) File "/usr/local/lib/python2.7/dist-", line 100, in apply self.flattenparameters() File "/usr/local/lib/python2.7/dist-", line 66, in flattenparameters if not or not (anyparam): File "/usr/local/lib/python2.7/dist-", line 87, in isacceptable if libcudnn() is None: File "/usr/local/lib/python2.7/dist-", line 58, in libcudnn 'but linked against {}'.format(compileversion, _cudnnversion)) RuntimeError: cuDNN version mismatch: PyTorch was compiled against 6021 but linked against 5110
that is weird. Can I see the full log of in pytorch directory. Can you make sure you have latest commits with .
I am sure the code is up-to-date. First I uninstall the code using the command pip unisntall torch. Then I remove the old code using the command rm -r pytorch and git clone again. The log of install is
Sorry to trouble you. Is there any new information on this issue?
I spent some time resolving this issue and I don't see too much about it online. Try ensuring that your Pytorch build is correct for your specific versions of Cuda and Cudnn. While I had the correct version of Pytorch, I resolved the issue by installing a different build of the same version. The build I installed is . Here are the list of versions and builds: You can download these files locally and install with conda: (assumes command is being run in a directory containing , where this file will be specific to your Cuda and Cudnn version.
feedback from this code PackagesNotFoundError
thank you - I have edited my comment to reflect that I installed from a local zip.

Discussion:
set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN") <del> find_path(CUDNN_INCLUDE_DIR cudnn.h </del> <ins> if($ENV{CUDNN_INCLUDE_DIR}) SET(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR}) else($ENV{CUDNN_INCLUDE_DIR}) find_path(CUDNN_INCLUDE_DIR cudnn.h </ins> HINTS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES cuda/include include) <ins> endif($ENV{CUDNN_INCLUDE_DIR}) </ins> <del> find_library(CUDNN_LIBRARY cudnn </del> <ins> if($ENV{CUDNN_LIBRARY}) SET(CUDNN_LIBRARY $ENV{CUDNN_LIBRARY}) else($ENV{CUDNN_LIBRARY}) find_library(CUDNN_LIBRARY cudnn </ins> HINTS ${CUDNN_LIB_DIR} ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64) <ins> endif($ENV{CUDNN_LIBRARY}) </ins> find_package_handle_standard_args( CUDNN DEFAULT_MSG CUDNN_INCLUDE_DIR CUDNN_LIBRARY)

"torch/csrc/cuda/python_nccl.cpp", ] if WITH_CUDNN: <del> main_libraries += ['cudnn'] library_dirs.insert(0, CUDNN_LIB_DIR) </del> <ins> main_libraries += [CUDNN_LIBRARY] </ins> # NOTE: these are at the front, in case there's another cuDNN in CUDA path include_dirs.insert(0, CUDNN_INCLUDE_DIR) if not IS_WINDOWS:

if IS_CONDA: lib_paths.append(os.path.join(CONDA_DIR, 'lib')) include_paths.append(os.path.join(CONDA_DIR, 'include')) <ins> for path in include_paths: if path is None or not os.path.exists(path): continue include_file_path = os.path.join(path, 'cudnn.h') if os.path.exists(include_file_path): CUDNN_INCLUDE_DIR = path CUDNN_INCLUDE_VERSION = -1 with open(include_file_path) as f: for line in f: if "#define CUDNN_MAJOR" in line: CUDNN_INCLUDE_VERSION = int(line.split()[-1]) break if CUDNN_INCLUDE_VERSION == -1: raise AssertionError("Could not find #define CUDNN_MAJOR in " + include_file_path) break </ins> for path in lib_paths: if path is None or not os.path.exists(path): continue

CUDNN_LIB_DIR = path break else: <del> libraries = sorted(glob.glob(os.path.join(path, 'libcudnn*'))) </del> <ins> libraries = sorted(glob.glob(os.path.join(path, 'libcudnn*' + str(CUDNN_INCLUDE_VERSION) + "*"))) </ins> if libraries: CUDNN_LIBRARY = libraries[0] CUDNN_LIB_DIR = path break <del> for path in include_paths: if path is None or not os.path.exists(path): continue if os.path.exists((os.path.join(path, 'cudnn.h'))): CUDNN_INCLUDE_DIR = path break </del> # Specifying the library directly will overwrite the lib directory library = os.getenv('CUDNN_LIBRARY') if library is not None and os.path.exists(library):