Theano / Theano

Theano was a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It is being continued as PyTensor: www.github.com/pymc-devs/pytensor

Home Page:https://www.github.com/pymc-devs/pytensor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

theano error cannot convert 'cudnnConvolutionFwdAlgo_t*' to 'cudnnConvolutionFwdAlgoPerf_t

drb3hn4m opened this issue · comments

My installed packages are:
CUDA 11.7, cudnn 8.5, theano 1.0.5
When I run the convolution network in the test file of Michael Nielsen's book on Deep Learning:

    import network3
    from network3 import Network, ConvPoolLayer, FullyConnectedLayer, SoftmaxLayer
    training_data, validation_data, test_data = network3.load_data_shared()
    mini_batch_size = 10
    net = Network([
            ConvPoolLayer(image_shape=(mini_batch_size, 1, 28, 28),filter_shape=(20, 1, 5, 5), poolsize=(2, 2)),FullyConnectedLayer(n_in=20*12*12, n_out=100),SoftmaxLayer(n_in=100, n_out=10)], mini_batch_size)
    net.SGD(training_data, 60, mini_batch_size, 0.1, 
                validation_data, test_data)   

I bump into the following error:

    Problem occurred during compilation with the command line below:
    /MYHOME/anaconda3/envs/behi/bin/x86_64-conda-linux-gnu-c++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -Wl,-rpath,/usr/local/cuda-11.7/lib64 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/MYHOME/anaconda3/envs/behi/lib/python3.10/site-packages/pygpu -I/MYHOME/anaconda3/envs/behi/lib/python3.10/site-packages/numpy/core/include -I/MYHOME/anaconda3/envs/behi/include -I/usr/local/cuda-11.7/include -I/MYHOME/anaconda3/envs/behi/lib/python3.10/site-packages/theano/gpuarray/c_code -I/MYHOME/anaconda3/envs/behi/lib/python3.10/site-packages/numpy/core/include -I/MYHOME/anaconda3/envs/behi/include/python3.10 -I/MYHOME/anaconda3/envs/behi/lib/python3.10/site-packages/theano/gof/c_code -L/MYHOME/anaconda3/envs/behi/lib -L/usr/local/cuda-11.7/lib64 -L/MYHOME/anaconda3/envs/behi/lib -fvisibility=hidden -o /MYHOME/.theano/compiledir_Linux-5.15--generic-x86_64-with-glibc2.35-x86_64-3.10.4-64/tmpf3qvese9/mc1cd627e616bc8abc33fbfac83f3f655fef0d5f1dc7018ab317b39356ccb88a5.so /MYHOME/.theano/compiledir_Linux-5.15--generic-x86_64-with-glibc2.35-x86_64-3.10.4-64/tmpf3qvese9/mod.cpp -lgpuarray -lcudnn -lpython3.10dnn_fwd.c: In member function 'int {anonymous}::__struct_compiled_op_mc1cd627e616bc8abc33fbfac83f3f655fef0d5f1dc7018ab317b39356ccb88a5::conv_fwd_node_mc1cd627e616bc8abc33fbfac83f3f655fef0d5f1dc7018ab317b39356ccb88a5_0(PyGpuArrayObject*, PyGpuArrayObject*, PyGpuArrayObject*, cudnnConvolutionDescriptor_t, double, double, PyGpuArrayObject**, _Params_c1c8b4ff173698da406f46c90c8211df3674b0478655765dc1ebaa6eb2c3f1af_1348bc2b76f74f3ee4c82e363ec6eacd0522bb7d4a29dd246904b25b733edb4a*)':
    dnn_fwd.c:326:60: error: invalid conversion from 'size_t {aka long unsigned int}' to 'int*' [-fpermissive]
    dnn_fwd.c:326:60: error: cannot convert 'cudnnConvolutionFwdAlgo_t*' to 'cudnnConvolutionFwdAlgoPerf_t* {aka cudnnConvolutionFwdAlgoPerfStruct*}' for argument '8' to 'cudnnStatus_t cudnnGetConvolutionForwardAlgorithm_v7(cudnnHandle_t, cudnnTensorDescriptor_t, cudnnFilterDescriptor_t, cudnnConvolutionDescriptor_t, cudnnTensorDescriptor_t, int, int*, cudnnConvolutionFwdAlgoPerf_t*)'

I understand that incompatibility of packages should be the reason, however I was wondering if there is any way to resolve this by modify the module or dnn_fwd.c or the theano's config file without downgrading the packages?