jay-mahadeokar / deeplab-public-ver2

This repo was mirrored from here: https://bitbucket.org/aquariusjay/deeplab-public-ver2
Other
25 stars 12 forks source link

Cannot run_densecrf.sh #5

Open useebear opened 7 years ago

useebear commented 7 years ago

I came across such a problem when run_densecrf.sh, it says:

./run_densecrf.sh: line 70: 9582 Segmentation fault (core dumped) ${CRF_BIN} -id ${IMG_DIR} -fd ${FEATURE_DIR} -sd ${SAVE_DIR} -i ${MAX_ITER} -px ${POS_X_STD} -py ${POS_Y_STD} -pw ${POS_W} -bx ${Bi_X_STD} -by ${Bi_Y_STD} -br ${Bi_R_STD} -bg ${Bi_G_STD} -bb ${Bi_B_STD} -bw ${Bi_W}

Cannot figure out why?

In the densecrf directory, when make, it says in the command window

...

g++ libDenseCRF/bipartitedensecrf.cpp libDenseCRF/densecrf.cpp libDenseCRF/filter.cpp libDenseCRF/permutohedral.cpp libDenseCRF/util.cpp -c -W -Wall -O2 In file included from libDenseCRF/bipartitedensecrf.cpp:27:0: libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from libDenseCRF/bipartitedensecrf.cpp:27:0: libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from libDenseCRF/util.h:31:0, from libDenseCRF/bipartitedensecrf.cpp:28: libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ libDenseCRF/bipartitedensecrf.cpp: At global scope: libDenseCRF/bipartitedensecrf.cpp:33:3: warning: unused parameter ‘o’ [-Wunused-parameter] BPPottsPotential( const BPPottsPotential&o ){} ^ In file included from libDenseCRF/densecrf.cpp:33:0: libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from libDenseCRF/densecrf.cpp:33:0: libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from libDenseCRF/densecrf.cpp:35:0: libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ libDenseCRF/densecrf.cpp: At global scope: libDenseCRF/densecrf.cpp:47:3: warning: unused parameter ‘o’ [-Wunused-parameter] PottsPotential( const PottsPotential&o ){} ^ In file included from libDenseCRF/filter.cpp:27:0: libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ In file included from libDenseCRF/filter.cpp:28:0: libDenseCRF/densecrf.h: At global scope: libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from libDenseCRF/filter.cpp:28:0: libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from libDenseCRF/permutohedral.cpp:28:0: libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ In file included from libDenseCRF/util.h:30:0, from libDenseCRF/util.cpp:31: libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from libDenseCRF/util.h:30:0, from libDenseCRF/util.cpp:31: libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from libDenseCRF/util.h:31:0, from libDenseCRF/util.cpp:31: libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ libDenseCRF/util.cpp: In function ‘unsigned char readPPM(const char, int&, int&)’: libDenseCRF/util.cpp:80:31: warning: ignoring return value of ‘char fgets(char, int, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fgets ( hdr+l, 256-l, fp ); ^ libDenseCRF/util.cpp:97:30: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread ( r, 1, WH3, fp ); ^ libDenseCRF/util.cpp:101:30: warning: ignoring return value of ‘int fscanf(FILE, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] fscanf ( fp, "%d", &c ); ^ ar rcs libDenseCRF.a bipartitedensecrf.o densecrf.o filter.o permutohedral.o util.o g++ test_densecrf/simple_dense_inference.cpp -o prog_test_densecrf -W -Wall -O2 -L. -lDenseCRF In file included from test_densecrf/simple_dense_inference.cpp:31:0: test_densecrf/../libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from test_densecrf/simple_dense_inference.cpp:31:0: test_densecrf/../libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ test_densecrf/../libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from test_densecrf/../libDenseCRF/util.h:31:0, from test_densecrf/simple_dense_inference.cpp:32: test_densecrf/../libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: test_densecrf/../libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ make[1]: Leaving directory .../deeplab-public-ver2/densecrf' make prog_refine_pascal make[1]: Entering directory.../deeplab-public-ver2/densecrf' g++ refine_pascal/dense_inference.cpp -o prog_refine_pascal -W -Wall -O2 -L. -lDenseCRF -I./refine_pascal/ -I./util/ In file included from refine_pascal/dense_inference.cpp:46:0: refine_pascal/../libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from refine_pascal/dense_inference.cpp:46:0: refine_pascal/../libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ refine_pascal/../libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from refine_pascal/../libDenseCRF/util.h:31:0, from refine_pascal/dense_inference.cpp:47: refine_pascal/../libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: refine_pascal/../libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ^ make[1]: Leaving directory .../deeplab-public-ver2/densecrf' make prog_refine_pascal_v4 make[1]: Entering directory.../deeplab-public-ver2/densecrf' g++ refine_pascal_v4/dense_inference.cpp -o prog_refine_pascal_v4 -W -Wall -O2 -L. -lDenseCRF -lmatio -I./util/ In file included from refine_pascal_v4/dense_inference.cpp:48:0: refine_pascal_v4/../libDenseCRF/densecrf.h:66:3: warning: unused parameter ‘o’ [-Wunused-parameter] DenseCRF(DenseCRF & o) {} ^ In file included from refine_pascal_v4/dense_inference.cpp:48:0: refine_pascal_v4/../libDenseCRF/densecrf.h:140:3: warning: unused parameter ‘o’ [-Wunused-parameter] BipartiteDenseCRF(BipartiteDenseCRF & o){} ^ refine_pascal_v4/../libDenseCRF/densecrf.h:185:3: warning: unused parameter ‘filter’ [-Wunused-parameter] Filter( const Filter& filter ){} ^ In file included from refine_pascal_v4/../libDenseCRF/util.h:31:0, from refine_pascal_v4/dense_inference.cpp:49: refine_pascal_v4/../libDenseCRF/permutohedral.h: In member function ‘void HashTable::grow()’: refine_pascal_v4/../libDenseCRF/permutohedral.h:83:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i=0; i<old_capacity; i++ ) ...

Tanzichang commented 7 years ago

I encounter the same problem and i don't know how to solve it? have you solved this problem? thank you!

aurooj commented 7 years ago

I encountered the same problem. Did any of you find the solution for this problem?

Tanzichang commented 7 years ago

I have solved this problem now. My problem was that the ppm images was generated incorrectly. And i solved this problem by regenerating the ppm images using the SaveJpgToPPM.m in the following website: https://bitbucket.org/deeplab/deeplab-public/src/26b6af817e4676f6409aa0d609096b31ff72917d/densecrf/my_script/?at=master

aurooj commented 7 years ago

Thanks for your reply. Are you using the same features produced from fc8 layer? If yes, then what are the dimensions of your features. I am actually using features produced from RefineNet (109x193x256 for each image) and wanted to run DenseCRF on those, but getting this segmentation fault. I regenerated the PPM files as you mentioned, but it still gives me same error. So, I suspect there is something to do with the features. Any help or hints will be highly appreciated.

Tanzichang commented 7 years ago

Yes, my features are also produced from fc8 layers. I ran the DeepLabv2_VGG16 with the caffe codes and configs provided by this website (http://liangchiehchen.com/projects/DeepLab.html). Thus the input size is 321x321 and the fc8 feature size is 41x41. I think you could try the official codes of DeepLabv2. I hope my reply can help you.

lixiang-ucas commented 6 years ago

@Tanzichang I encountered the same problem, can you give any suggestions? I'm using python script to convert jpgs to ppms rather than SaveJpgToPPM.m.

Tanzichang commented 6 years ago

@lixiang-ucas I think you could try the official codes of DeepLab, and I encountered several problems when using this project. By the way, I am also a student from UCAS.