hikopensource / DAVAR-Lab-OCR

OCR toolbox from Davar-Lab
Apache License 2.0
724 stars 153 forks source link

Installation Issue: Can't seem to figure this one out #117

Open ANANYANAYAN opened 1 year ago

ANANYANAYAN commented 1 year ago

Processing dependencies for davarocr==0.6.0 Finished processing dependencies for davarocr==0.6.0 10 setup.sh: line 41: cd: too many arguments sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory grep: ./CMakeLists.txt: No such file or directory setup.sh: line 50: [: -ne: unary operator expected sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory sed: can't read CMakeLists.txt: No such file or directory setup.sh: line 69: cd: too many arguments setup.sh: line 74: cd: too many arguments setup.sh: line 77: cmake: command not found make: *** No targets specified and no makefile found. Stop. setup.sh: line 80: cd: too many arguments python: can't open file 'setup.py': [Errno 2] No such file or directory

ANANYANAYAN commented 1 year ago

sorted this error, had to put quotes on the path variable "$ROOT/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/"

ANANYANAYAN commented 1 year ago

This is where I am finally getting stuck at

The File Has Ever Been Installed! -- cuda found TRUE -- Building shared library with GPU support -- Configuring done -- Generating done -- Build files have been written to: /media/ananyanayan/New Volume/PycharmProjects/Table Detection/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build [ 33%] Built target warpctc [ 66%] Built target test_gpu [100%] Built target test_cpu running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt /home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/torch/utils/cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext Traceback (most recent call last): File "setup.py", line 54, in setup( File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(*attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 167, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command self.run_command(cmdname) File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/usr/lib/python3.8/distutils/command/install_lib.py", line 109, in build self.run_command('build_ext') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 420, in build_extensions compiler_name, compiler_version = self._check_abi() File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 791, in _checkabi , version = get_compiler_abi_compatibility_and_version(compiler) File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 324, in get_compiler_abi_compatibility_and_version if not check_compiler_ok_for_platform(compiler): File "/home/ananyanayan/.virtualenvs/davar/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 280, in check_compiler_ok_for_platform which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT) File "/usr/lib/python3.8/subprocess.py", line 415, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['which', 'x86_64-linux-gnu-g++']' returned non-zero exit status 1

qiaoliang6 commented 1 year ago

The installation of warpctc somehow depends on the envrionment. Because this package relies on third-party libraries that are no longer maintained, the support for higher-end platforms is not as good. You may go to FAQ for more information.

If you do not need to train the ctc text recognition model, you can comment out the relevant reference in the code, which does not affect the use of other functions.

jigsawcoder commented 1 year ago

I want to infer the LGPMA model offline on my own table dataset.

I tried to solve this error by performing changes shown in FAQ but the error still remains.

Installed /content/drive/MyDrive/davar/DAVAR-Lab-OCR Processing dependencies for davarocr==0.6.0 Finished processing dependencies for davarocr==0.6.0 11 CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- cuda found TRUE -- Building shared library with GPU support -- Configuring done -- Generating done -- Build files have been written to: /content/drive/MyDrive/davar/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build [-11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o [ 0%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o /content/drive/MyDrive/davar/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu(1): error: this declaration has no storage class or type specifier

/content/drive/MyDrive/davar/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu(1): error: expected a ";"

2 errors detected in the compilation of "/content/drive/MyDrive/davar/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/src/ctc_entrypoint.cu". CMake Error at warpctc_generated_ctc_entrypoint.cu.o.cmake:280 (message): Error generating file /content/drive/MyDrive/davar/DAVAR-Lab-OCR/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_ctc_entrypoint.cu.o

CMakeFiles/warpctc.dir/build.make:234: recipe for target 'CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o' failed make[2]: [CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o] Error 1 CMakeFiles/Makefile2:86: recipe for target 'CMakeFiles/warpctc.dir/all' failed make[1]: [CMakeFiles/warpctc.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2 Could not find libwarpctc.so in ../build. Build warp-ctc and set WARP_CTC_PATH to the location of libwarpctc.so (default is '../build')

I tried commenting on the lines shown in the FAQ but nothing works. If there are any other lines that needs to be commented, please let me know. Please Help