DayBreak-u / chineseocr_lite

超轻量级中文ocr,支持竖排文字识别, 支持ncnn、mnn、tnn推理 ( dbnet(1.8M) + crnn(2.5M) + anglenet(378KB)) 总模型仅4.7M
GNU General Public License v2.0
11.72k stars 2.25k forks source link

Loading Error #4

Open fengredrum opened 4 years ago

fengredrum commented 4 years ago

Loading test image from web browser got this error: `find: -xtype: unknown primary or operator make: pse.so is up to date. device: cpu load models device: cpu load models device: cpu load models device: cpu load models http://0.0.0.0:8080/ 127.0.0.1:57218 - - [04/Mar/2020 16:53:54] "HTTP/1.1 GET /ocr" - 200 OK Traceback (most recent call last): File "/Users/oblivion/anaconda3/envs/tf37/lib/python3.7/site-packages/web/application.py", line 289, in process return self.handle() File "/Users/oblivion/anaconda3/envs/tf37/lib/python3.7/site-packages/web/application.py", line 280, in handle return self._delegate(fn, self.fvars, args) File "/Users/oblivion/anaconda3/envs/tf37/lib/python3.7/site-packages/web/application.py", line 530, in _delegate return handle_class(cls) File "/Users/oblivion/anaconda3/envs/tf37/lib/python3.7/site-packages/web/application.py", line 508, in handle_class return tocall(*args) File "/Users/oblivion/chineseocr_lite/app.py", line 83, in POST result= text_predict(img) File "/Users/oblivion/chineseocr_lite/model.py", line 119, in text_predict preds, boxes_list, rects_re, t = text_handle.predict(img, long_size=pse_long_size) File "/Users/oblivion/chineseocr_lite/psenet/PSENET.py", line 99, in predict preds, boxes_list,rects = pse_decode(preds[0], self.scale) File "/Users/oblivion/chineseocr_lite/psenet/pse/init.py", line 58, in decode pred, label_values = pse_warpper(preds, 5) File "/Users/oblivion/chineseocr_lite/psenet/pse/init.py", line 19, in pse_warpper from .pse import pse_cpp ImportError: dlopen(/Users/oblivion/chineseocr_lite/psenet/pse/pse.so, 2): no suitable image found. Did find: /Users/oblivion/chineseocr_lite/psenet/pse/pse.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03 /Users/oblivion/chineseocr_lite/psenet/pse/pse.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03

127.0.0.1:57226 - - [04/Mar/2020 16:54:43] "HTTP/1.1 POST /ocr" - 500 Internal Server Error `

Any idea what happened? Platform: MacOS 10.15.3 Python 3.7 Pytorch 1.4.0

DayBreak-u commented 4 years ago

try cd psenet dir to make pse moudle?

fengredrum commented 4 years ago

I'm sorry, I'm not familiar with C++, could you explain more specifically?

DayBreak-u commented 4 years ago

cd psenet/pse rm -rf pse.so make

fengredrum commented 4 years ago

Still no sign of luck...

cmake output is: find: -xtype: unknown primary or operator c++ -o pse.so -I include -std=c++11 -O3 -I/Users/oblivion/anaconda3/include/python3.7m -I/Users/oblivion/anaconda3/include/python3.7m -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/oblivion/anaconda3/include -arch x86_64 -I/Users/oblivion/anaconda3/include -arch x86_64 -L/Users/oblivion/anaconda3/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation pse.cpp --shared -fPIC pse.cpp:32:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:39:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:42:32: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for(size_t j = 0; j<w; j++) ~^~ 3 warnings generated. warning: (x86_64) /tmp/lto.o unable to open object file: No such file or directory

And run app.py got this error: find: -xtype: unknown primary or operator make: `pse.so' is up to date. device: cpu load models device: cpu load models device: cpu load models device: cpu load models http://0.0.0.0:8080/ 127.0.0.1:57911 - - [04/Mar/2020 18:55:49] "HTTP/1.1 GET /ocr" - 200 OK zsh: segmentation fault python app.py 8080

DayBreak-u commented 4 years ago

I'm sorry! I was experimenting with Linux, and I probably didn't know there were problems with Unix

ninjarz commented 4 years ago

Still no sign of luck...

cmake output is: find: -xtype: unknown primary or operator c++ -o pse.so -I include -std=c++11 -O3 -I/Users/oblivion/anaconda3/include/python3.7m -I/Users/oblivion/anaconda3/include/python3.7m -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/oblivion/anaconda3/include -arch x86_64 -I/Users/oblivion/anaconda3/include -arch x86_64 -L/Users/oblivion/anaconda3/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation pse.cpp --shared -fPIC pse.cpp:32:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:39:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:42:32: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for(size_t j = 0; j<w; j++) ~^~ 3 warnings generated. warning: (x86_64) /tmp/lto.o unable to open object file: No such file or directory

And run app.py got this error: find: -xtype: unknown primary or operator make: `pse.so' is up to date. device: cpu load models device: cpu load models device: cpu load models device: cpu load models http://0.0.0.0:8080/ 127.0.0.1:57911 - - [04/Mar/2020 18:55:49] "HTTP/1.1 GET /ocr" - 200 OK zsh: segmentation fault python app.py 8080

Do not use conda, run this in you bash: conda deactivate and make it again

fengredrum commented 4 years ago

Still no sign of luck... cmake output is: find: -xtype: unknown primary or operator c++ -o pse.so -I include -std=c++11 -O3 -I/Users/oblivion/anaconda3/include/python3.7m -I/Users/oblivion/anaconda3/include/python3.7m -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/oblivion/anaconda3/include -arch x86_64 -I/Users/oblivion/anaconda3/include -arch x86_64 -L/Users/oblivion/anaconda3/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation pse.cpp --shared -fPIC pse.cpp:32:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:39:29: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i<h; i++) ~^~ pse.cpp:42:32: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for(size_t j = 0; j<w; j++) ~^~ 3 warnings generated. warning: (x86_64) /tmp/lto.o unable to open object file: No such file or directory And run app.py got this error: find: -xtype: unknown primary or operator make: `pse.so' is up to date. device: cpu load models device: cpu load models device: cpu load models device: cpu load models http://0.0.0.0:8080/ 127.0.0.1:57911 - - [04/Mar/2020 18:55:49] "HTTP/1.1 GET /ocr" - 200 OK zsh: segmentation fault python app.py 8080

Do not use conda, run this in you bash: conda deactivate and make it again

Thx. But got same error as before. But I've successful run the code in a Docker container.