Git Product home page Git Product logo

Comments (13)

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

You should install C++ version opencv before in your environment. You can find instructions in the official site.

The package of 'opencv' is only used by the algorithms of EAST and Text Perceptron Det. If you do not use them, you can simply remove the codes of L12-L15 in 'davarocr/setup.sh', and it would not affect other algorithms.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

I removed the codes of L12-L15 however I get a new error! How can this error be resolved?
(I also removed lines L16-17 but still the same error! Note that Keeping lines L16-L17 throws "No package 'opencv' found error")

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /software/eb/software/CUDAcore/11.1.1 (found suitable version "11.1", minimum required is "6.5")
-- cuda found TRUE
-- Building shared library with GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build
[ 11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
[ 22%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
In file included from /usr/include/c++/4.8.2/tuple:35:0,
from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/include/detail/cpu_ctc.h:3,
from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu:7:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
CMake Error at warpctc_generated_ctc_entrypoint.cu.o.cmake:220 (message):
Error generating
/DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_ctc_entrypoint.cu.o

make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o] Error 1
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
make: *** [all] Error 2

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

I removed the codes of L12-L15 however I get a new error! How can this error be resolved? (I also removed lines L16-17 but still the same error! Note that Keeping lines L16-L17 throws "No package 'opencv' found error")

-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA: /software/eb/software/CUDAcore/11.1.1 (found suitable version "11.1", minimum required is "6.5") -- cuda found TRUE -- Building shared library with GPU support -- Configuring done -- Generating done -- Build files have been written to: /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build [ 11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. [ 22%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. In file included from /usr/include/c++/4.8.2/tuple:35:0, from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/include/detail/cpu_ctc.h:3, from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu:7: /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the ^ CMake Error at warpctc_generated_ctc_entrypoint.cu.o.cmake:220 (message): Error generating /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_ctc_entrypoint.cu.o

make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o] Error 1 make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2 make: *** [all] Error 2

This problem is mentioned in 'docs/FQA.md'

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

I removed the codes of L12-L15 however I get a new error! How can this error be resolved? (I also removed lines L16-17 but still the same error! Note that Keeping lines L16-L17 throws "No package 'opencv' found error")
-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA: /software/eb/software/CUDAcore/11.1.1 (found suitable version "11.1", minimum required is "6.5") -- cuda found TRUE -- Building shared library with GPU support -- Configuring done -- Generating done -- Build files have been written to: /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build [ 11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. [ 22%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. In file included from /usr/include/c++/4.8.2/tuple:35:0, from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/include/detail/cpu_ctc.h:3, from /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu:7: /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the ^ CMake Error at warpctc_generated_ctc_entrypoint.cu.o.cmake:220 (message): Error generating /DAVAR-Lab-OCR/davarocr/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_ctc_entrypoint.cu.o
make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o] Error 1 make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2 make: *** [all] Error 2

This problem is mentioned in 'docs/FQA.md'

You can also remove the import of 'warp_ctc' if not using CTC recognizor temporarily.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

I removed 'warp_ctc' However I ran into this error while running the demo!
Thanks!

Traceback (most recent call last):
File "test_pub.py", line 19, in
from davarocr.davar_common.apis import inference_model, init_model
File "=DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in
from .davar_det import *
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in
from .datasets import *
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in
from .text_det_dataset import TextDetDataset
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in
from ..core.evaluation.hmean import evaluate_method
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in
from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in
from .post_east import PostEAST
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 26, in
lib = ctl.load_library(lib_name, lib_dir)
File "/home/yjamshid/anaconda3/envs/lg/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

The issue is the same with #12 .
Or you can update the code. I have remove the global calling for EAST, and this problem would not affect other algorithms.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

I still get this error:

Traceback (most recent call last):
File "test_pub.py", line 19, in
from davarocr.davar_common.apis import inference_model, init_model
File "/DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in
from .davar_det import *
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in
from .datasets import *
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in
from .text_det_dataset import TextDetDataset
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in
from ..core.evaluation.hmean import evaluate_method
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in
from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in
from .post_east import PostEAST
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 26, in
lib = ctl.load_library(lib_name, lib_dir)
File "/home/yjamshid/anaconda3/envs/lg/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

I still get this error:

Traceback (most recent call last): File "test_pub.py", line 19, in from davarocr.davar_common.apis import inference_model, init_model File "/DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in from .davar_det import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in from .datasets import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in from .text_det_dataset import TextDetDataset File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in from ..core.evaluation.hmean import evaluate_method File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in from .post_east import PostEAST File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 26, in lib = ctl.load_library(lib_name, lib_dir) File "/home/yjamshid/anaconda3/envs/lg/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library raise OSError("no file with expected extension") OSError: no file with expected extension

Have you updated and re-built the code? The line 26 of "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py" is not this line.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

I still get this error:

Traceback (most recent call last): File "test_pub.py", line 19, in from davarocr.davar_common.apis import inference_model, init_model File "/DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in from .davar_det import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in from .datasets import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in from .text_det_dataset import TextDetDataset File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in from ..core.evaluation.hmean import evaluate_method File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in from .post_east import PostEAST File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 26, in lib = ctl.load_library(lib_name, lib_dir) File "/home/yjamshid/anaconda3/envs/lg/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library raise OSError("no file with expected extension") OSError: no file with expected extension

Have you updated and re-built the code? The line 26 of "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py" is not this line.

I did not find any new PR. Can you specify how to get the latest code? Thanks

On Mon, Oct 11, 2021 at 7:34 PM Liang Qiao @.***> wrote: I still get this error: Traceback (most recent call last): File "test_pub.py", line 19, in from davarocr.davar_common.apis import inference_model, init_model File "/DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in from .davar_det import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in from .datasets import * File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in from .text_det_dataset import TextDetDataset File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in from ..core.evaluation.hmean import evaluate_method File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in from .post_east import PostEAST File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 26, in lib = ctl.load_library(lib_name, lib_dir) File "/home/yjamshid/anaconda3/envs/lg/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library raise OSError("no file with expected extension") OSError: no file with expected extension Have you updated and re-built the code? The line 26 of "/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py" is not this line. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#16 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECILPBKAOF5ULJVR7XDUVDUGONCLANCNFSM5FPEQGLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

The code was not push by PR. Directly update code using 'git pull' or download the newest .zip.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

I pulled the lates code and it seems the issue is resolved. However I get the below error which is related to the checkpoint.
I downloaded the checkpoint from Google drive. I wonder why it is not recognizing it.

File "test_pub.py", line 30, in
model = init_model(config_file, checkpoint_file)
File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_common/apis/inference.py", line 68, in init_model
checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
File "/mmcv/runner/checkpoint.py", line 513, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location, logger)
File "/mmcv/runner/checkpoint.py", line 451, in _load_checkpoint
return CheckpointLoader.load_checkpoint(filename, map_location, logger)
File "/mmcv/runner/checkpoint.py", line 244, in load_checkpoint
return checkpoint_loader(filename, map_location)
File "/mmcv/runner/checkpoint.py", line 260, in load_from_local
raise IOError(f'{filename} is not a checkpoint file')
OSError: /DAVAR-Lab-OCR/demo/table_recognition/lgpma/ckg/maskrcnn-lgpma-pub-e12-pub.pth is not a checkpoint file

from davar-lab-ocr.

qiaoliang6 avatar qiaoliang6 commented on June 27, 2024

I pulled the lates code and it seems the issue is resolved. However I get the below error which is related to the checkpoint. I downloaded the checkpoint from Google drive. I wonder why it is not recognizing it.

File "test_pub.py", line 30, in model = init_model(config_file, checkpoint_file) File "/DAVAR-Lab-OCR/davarocr/davarocr/davar_common/apis/inference.py", line 68, in init_model checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc) File "/mmcv/runner/checkpoint.py", line 513, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location, logger) File "/mmcv/runner/checkpoint.py", line 451, in _load_checkpoint return CheckpointLoader.load_checkpoint(filename, map_location, logger) File "/mmcv/runner/checkpoint.py", line 244, in load_checkpoint return checkpoint_loader(filename, map_location) File "/mmcv/runner/checkpoint.py", line 260, in load_from_local raise IOError(f'{filename} is not a checkpoint file') OSError: /DAVAR-Lab-OCR/demo/table_recognition/lgpma/ckg/maskrcnn-lgpma-pub-e12-pub.pth is not a checkpoint file

Have you checked whether the path is correct?
If so, what is the Pytorch version are you using? the model trained on enviroment of Pytorch1.6+ might not compatible with <Pytorch1.6.

from davar-lab-ocr.

iazdan avatar iazdan commented on June 27, 2024

The Pytorch version was causing the issue. Thanks for your prompt response!

from davar-lab-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.