Closed chzeze closed 6 years ago
Hi. As mentioned in the readme, the code does not work with current versions of tensorflow. Please try the version from requirements.txt (tensorflow==0.12.1) or try to use the docker container.
Further, there is a bug in the character-based word representation layer if Keras + Tensorflow is used in the specified version. The option is to either disable the character-based word representation layer by setting it to None, or to use Theano instead of tensorflow. With Theano and the correct version of Keras, all components should work.
Please try also the docker version of this code if you have issues with running it. The docker file ensures that all dependencies have the right version.
Hi , this is my backen
funcsigs (1.0.2) h5py (2.6.0) Keras (1.2.2) mock (2.0.0) nltk (3.2.2) numpy (1.13.3) pbr (3.1.1) pip (9.0.1) protobuf (3.5.0.post1) PyYAML (3.12) scikit-learn (0.19.1) scipy (1.0.0) setuptools (38.2.4) six (1.11.0) sklearn (0.0) tensorflow (0.12.1) Theano (0.9.0) wheel (0.30.0)
I use the Theano 0.9.0 ,output these problem: python Train_NER_German.py Using Theano backend.
mod.cu(77): error: identifier "cudnnSetFilterNdDescriptor_v4" is undefined mod.cu(326): warning: conversion from a string literal to "char " is deprecated mod.cu(329): warning: conversion from a string literal to "char " is deprecated mod.cu(332): warning: conversion from a string literal to "char " is deprecated mod.cu(335): warning: conversion from a string literal to "char " is deprecated mod.cu(338): warning: conversion from a string literal to "char " is deprecated mod.cu(341): warning: conversion from a string literal to "char " is deprecated mod.cu(345): warning: conversion from a string literal to "char *" is deprecated 1 error detected in the compilation of "/tmp/tmpxft_00002026_00000000-9_mod.cpp1.ii".
['/usr/local/cuda/bin/nvcc', '-shared', '-O3', '-Xlinker', '-rpath,/usr/local/cuda/lib64', '-use_fast_math', '-arch=sm_61', '-m64', '-Xcompiler', '-fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden', '-Xlinker', '-rpath,/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-I/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-I/usr/local/cuda/include', '-I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/theano/sandbox/cuda', '-I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/numpy/core/include', '-I/home/fzuir/anaconda2/include/python2.7', '-I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/theano/gof', '-L/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-L/home/fzuir/anaconda2/lib', '-o', '/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/tmpThChR0/ea4e203b6529466794536f8a1bfa77ae.so', 'mod.cu', '-lcudart', '-lcublas', '-lcuda_ndarray', '-lcudnn', '-lpython2.7']
Traceback (most recent call last):
File "Train_MultiTask.py", line 72, in
AssertionError: AbstractConv2d Theano optimization failed: there is no implementation available supporting the requested options. Did you exclude both "conv_dnn" and "conv_gemm" from the optimizer? If on GPU, is cuDNN available and does the GPU support it? If on CPU, do you have a BLAS library installed Theano can link against?
Looks like an incompatible version of cuDNN and Theano 0.9.0 or some error between these two components.
I was running my experiments on CPU. The GPU speed-up for LSTMs were in my experiments rather low and sometimes there was no speed-up at all. For CPU, I use a BLAS library. On Ubuntu, you can either use the pre-compiled OpenBlas lib from the package repository or compile it by yourself and link it against Theano.
Thank you I change the cuDnn to version 5.0 solution this problem
Exception: ('The following error happened while compiling the node', GpuDnnConv{algo='small', inplace=True}(GpuContiguous.0, GpuContiguous.0, GpuAllocEmpty.0, GpuDnnConvDesc{border_mode='half', subsample=(1, 1), conv_mode='conv', precision='float32'}.0, Constant{1.0}, Constant{0.0}), '\n', 'nvcc return status', 2, 'for cmd', '/usr/local/cuda/bin/nvcc -shared -O3 -Xlinker -rpath,/usr/local/cuda/lib64 -use_fast_math -arch=sm_61 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden -Xlinker -rpath,/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -I/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -I/usr/local/cuda/include -I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/theano/sandbox/cuda -I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/numpy/core/include -I/home/fzuir/anaconda2/include/python2.7 -I/home/fzuir/czz/git/emnlp2017-bilstm-cnn-crf/.env/lib/python2.7/site-packages/theano/gof -L/home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -L/home/fzuir/anaconda2/lib -o /home/fzuir/external/.theano/compiledir_Linux-4.2--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/tmpeIWWZR/ea4e203b6529466794536f8a1bfa77ae.so mod.cu -lcudart -lcublas -lcuda_ndarray -lcudnn -lpython2.7', "[GpuDnnConv{algo='small', inplace=True}(<CudaNdarrayType(float32, (False, False, False, True))>, <CudaNdarrayType(float32, 4D)>, <CudaNdarrayType(float32, 4D)>, <CDataType{cudnnConvolutionDescriptor_t}>, Constant{1.0}, Constant{0.0})]")