MangaLineExtraction
MangaLineExtraction copied to clipboard
AssertionError: AbstractConv2d Theano optimization failed
Thanks for sharing the good code.
- I created a new virtual env and installed all components.
- I modified keras.json as recommended.
but some errors occurred when I ran, any one can help me? @ljsabc :
==================================== Using Theano backend. WARNING (theano.configdefaults): g++ not available, if using conda:conda install m2w64-toolchain
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python im plementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string. ./Arisa\Arisa_005.jpg ERROR (theano.gof.opt): Optimization failure due to: local_abstractconv_check ERROR (theano.gof.opt): node: AbstractConv2d{convdim=2, border_mode='half', subsample=(1, 1), filter_flip=True, imshp=(None, None, None, None), kshp=(24, 1, 3, 3), f ilter_dilation=(1, 1)}(Elemwise{add,no_inplace}.0, convolution2d_1_W) ERROR (theano.gof.opt): TRACEBACK: ERROR (theano.gof.opt): Traceback (most recent call last): File "D:\Anaconda3\envs\MangoLineExtraction\lib\site-packages\theano\gof\opt.py", line 1982, in process_node replacements = lopt.transform(node) File "D:\Anaconda3\envs\MangoLineExtraction\lib\site-packages\theano\tensor\nnet\opt.py", line 609, in local_abstractconv_check raise AssertionError( 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?
Traceback (most recent call last):
File "test_mse.py", line 85, in
I guess you need to stick to CuDNN 5. It would be better if you can provide more env-related information. Also, as Theano and Keras 1.x are not supported, it's highly recommended to migrate the weight to something like tf or pytorch.
thank you@ljsabc. i searched Stackoverflow about this problem and found a solution in which it is suggested to add "optimizer = None" to file .theanorc. i did so, however a new problem occurred. when executing test_mse.py, something like "Arisa_005.jpg" appears on the screen (seems it begin to run), and then it stops there, nothing new happens. i have to stop it. so ,what is the reason? do you have some suggestions?
The first execution takes time. Please take a look at the CPU usage.
how long it takes for the first execution? I waited more than 10 minutes, and still, nothing happened. here is a screenshot:
the cpu occupation rate is about 10%.
I don't think you have fully understood the internal mechanism of code optimization.
- g++ and nvcc is mandatory for a successful execution
- nvcc/g++/other compilations will be run for the first time, taking around 10 mins on my testbed
- 10% for all cores, or for a single core? Typically during compilation you will have 1 core fully occupied.
- after the code has been compiled, with a decent GPU you can achieve <1s/1Mpixel speed.
- you mean i should install something like g++ and nvcc? what should I do? i have installed cuda and cudnn.
- there is 4 cores, total occupation rate is 10%
- i added the following code into .theanorc file. "[global] floatX = float32 device = cpu optimizer = None" or "[global] floatX = float32 device = cuda optimizer = None" there is no difference, nothing changed. tell me if i am wrong.
I'm sorry but I think you need to sort it out yourself.
Attached is my keras.json and .theanorc (For Windows)
.theanorc
[global]
floatX = float32
device = gpu
[nvcc]
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
fastmath = True
[compile]
cxxflags = -O3 -ffast-math -ftree-loop-distribution -ftracer
mode = FAST_RUN
[dnn]
enabled = True
include_path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include
library_path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64
[lib]
cnmem = 0.7
keras.json
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "theano"
}
i am still in trouble, but many thanks for your rapid response and help!