MichalBusta / E2E-MLT

E2E-MLT - an Unconstrained End-to-End Method for Multi-Language Scene Text
MIT License
291 stars 84 forks source link

RuntimeError: Cannot compile nms: #62

Closed MiTeng0215 closed 4 years ago

MiTeng0215 commented 4 years ago
(e2e) mist@C-000005-GPU:~/home/E2E-MLT-master$ python3 demo.py -model=e2e-mlt.h5 
make: Entering directory '/home/mist/home/E2E-MLT-master/nms'
g++ -o adaptor.so -I include  -std=c++11 -O3 -I/home/mist/anaconda3/envs/e2e/include/python3.6m -I/home/mist/anaconda3/envs/e2e/include/python3.6m  -Wno-unused-result -Wsign-compare -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -ffunction-sections -pipe -isystem /home/mist/anaconda3/envs/e2e/include -fdebug-prefix-map=/tmp/build/80754af9/python_1578429706181/work=/usr/local/src/conda/python-3.6.10 -fdebug-prefix-map=/home/mist/anaconda3/envs/e2e=/usr/local/src/conda-prefix -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -flto -DNDEBUG -fwrapv -O3 -Wall -L/home/mist/anaconda3/envs/e2e/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/home/mist/anaconda3/envs/e2e/lib -lpython3.6m -lpthread -ldl  -lutil -lrt -lm  -Xlinker -export-dynamic adaptor.cpp include/clipper/clipper.cpp --shared -fPIC
In file included from adaptor.cpp:5:0:
../nms/nms.h: In member function 'void nms::PolyMerger::add(const nms::Polygon&)':
../nms/nms.h:77:19: error: 'const struct nms::Polygon' has no member named 'nr_polys'; did you mean 'poly'?
     nr_polys += p.nr_polys;
                   ^~~~~~~~
                   poly
include/clipper/clipper.cpp: In member function 'void ClipperLib::Clipper::FixupFirstLefts3(ClipperLib::OutRec*, ClipperLib::OutRec*)':
include/clipper/clipper.cpp:3666:13: warning: unused variable 'firstLeft' [-Wunused-variable]
     OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft);
             ^~~~~~~~~
Makefile:10: recipe for target 'adaptor.so' failed
make: *** [adaptor.so] Error 1
make: Leaving directory '/home/mist/home/E2E-MLT-master/nms'
Traceback (most recent call last):
  File "demo.py", line 10, in <module>
    from nms import get_boxes
  File "/home/mist/home/E2E-MLT-master/nms/__init__.py", line 8, in <module>
    raise RuntimeError('Cannot compile nms: {}'.format(BASE_DIR))
RuntimeError: Cannot compile nms: /home/mist/home/E2E-MLT-master/nms

can you help me ?

MiTeng0215 commented 4 years ago

@MichalBusta

(e2e) mist@C-000005-GPU:~/home/E2E-MLT-master$ python demo.py -model=e2e-mlt.h5        
make: Entering directory '/home/mist/home/E2E-MLT-master/nms'
make: 'adaptor.so' is up to date.
make: Leaving directory '/home/mist/home/E2E-MLT-master/nms'
Traceback (most recent call last):
  File "/home/mist/home/E2E-MLT-master/net_utils.py", line 30, in load_net
    v.copy_(param)
RuntimeError: The expanded size of the tensor (8400) must match the existing size (7500) at non-singleton dimension 0
Traceback (most recent call last):
  File "/home/mist/home/E2E-MLT-master/net_utils.py", line 30, in load_net
    v.copy_(param)
RuntimeError: The expanded size of the tensor (8400) must match the existing size (7500) at non-singleton dimension 0
e2e-mlt.h5
Using cuda ...

Awesome! nms compiled successfully! But a new problem has arisen, I don't know why the tensor has a problem.

MichalBusta commented 4 years ago

Hi, there are 2 models provided - one with 7500 softmax and second with 8400 softmax. For demo use http://ptak.felk.cvut.cz/public_datasets/SyntText/e2e-mlt.h5 model or change model definition in code - see models.py

https://github.com/MichalBusta/E2E-MLT/blob/498e94e08912c123d0179a395dc3e4d4baba423b/models.py#L217 https://github.com/MichalBusta/E2E-MLT/blob/498e94e08912c123d0179a395dc3e4d4baba423b/models.py#L485

All the best, Michal

MiTeng0215 commented 4 years ago

Now it worked. I modified the code of model.py based the #issue49.Thank you for your quick reply, thank you.