Closed masc4ii closed 4 years ago
This is the line, where the crash happens:
Hi masc4ii,
This project is incomplete, and I am trying my best on conv2
segmentation fault.
I will fix this issue as soon as possible :)
Great! :)
Fixed in commit 242c98a
.
Hi @masc4ii , I have fixed seg fault issue. However, the output presents ringing effect. If you have any idea about solving this, it would be glad :)
Thank you for fixing. The program runs now without crash, but needs around 30min for lenna.bmp. Maybe I could have a look to accelerate with openMP (parallel for loop). I can see the ringing effect but so far I don't know how to solve this. Do you process only B/W at the moment?
Current my SRCNN can only support grayscale image (color image will be transformed to grayscale before super-resolution).
Of course, adding openMP is quite welcome :)
By the way, on my computer it takes about 4min for lenna.bmp. I am curious about your environment.
I have problems to integrate openMP into the cmake project file. Do you know how to get it included there? In other projects (Qt projects) I do this:
QMAKE_CC = /usr/local/opt/llvm/bin/clang
QMAKE_CXX = /usr/local/opt/llvm/bin/clang++
QMAKE_LINK = /usr/local/opt/llvm/bin/clang++
QMAKE_CFLAGS += -fopenmp
QMAKE_CXXFLAGS += -fopenmp
INCLUDEPATH += -I/usr/local/opt/llvm/include
LIBS += -L/usr/local/opt/llvm/lib -lgomp
Could you try to translate this to cmake? This code is for OSX, maybe it also works for Linux. On Windows the paths should be different - sure. Maybe there is also an easier way to integrate openMP with cmake - no idea.
I tried your project on a MBP2013, i5 DualCore 2.4GHz.
I will try to add OpenMP with Cmake later soon. edit: I create an example of OpenMP with CMake. Feel free to use it: https://github.com/Cuda-Chen/openmp_practice/blob/master/hello_cmake/CMakeLists.txt
By the way, maybe you can check im2col() function. I think it is the reason why it runs slowly.
Thank you. Unfortunately I get this with that:
CMake Error at /usr/local/Cellar/cmake/3.16.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.16.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.16.3/share/cmake/Modules/FindOpenMP.cmake:511 (find_package_handle_standard_args)
CMakeLists.txt:22 (find_package)
On the first view I can't see something bad in im2col(). What makes you think it could be the reason?
I wrote a Qt project file (without Qt dependencies, just as automatism to create a makefile, instead of cmake), got openMP and openCV working with it. I made some little changes to the code and now it processes in ~8.x min (~30 min before), so the 4 threads multithreading (DualCore + HT) seem to work here nicely. The final image looks identically (so multithreading seems not to create additional problems). I should clone your project and do a pull request.
If you like to try: https://github.com/masc4ii/SRCNN-cpp (You should insert openMP in the cmake for your system. I did not do this yet.)
I have visited your work, and it's pretty awesome! On my 8-core mac, openMP version takes about 1min compared to 4min with single-core. Pretty huge speed up.
I think I can merge the qmake
for another compilation option.
At last, I have been working on the weight format this month, and today I let the result to be 'correct'. But the code changes a lot, so I think I will take some time to merge the work.
Anyway, remember to write your name on README for this honorable moment!
Hi @masc4ii , I merged your pull request and develop branch yesterday. I will work on using OpenMP with CMake as an option later.
Also, I added your name in README. Cheers!
I tried to run your code, but ended with a "Segmentation fault: 11". I am on OSX 10.13, and use openCV4.2.0. The program compiled without problem. This is the output when running:
Any idea? Thanks for your help!