Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: no file with expected extension 估计是个numpy ctypeslib.py 问题 #12

Closed
EYcab opened this issue Sep 25, 2021 · 7 comments
Closed

Comments

@EYcab
Copy link

EYcab commented Sep 25, 2021

(otrpy37) server@server-Z590-UD:~/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr$ python
Python 3.7.0 (default, Oct 9 2018, 10:31:47)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

from davarocr.davar_common.apis import inference_model
east_postprocess.so
/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/lib
Traceback (most recent call last):
File "", line 1, in
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/init.py", line 12, in
from .davar_det import *
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/init.py", line 11, in
from .datasets import *
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/init.py", line 12, in
from .text_det_dataset import TextDetDataset
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/datasets/text_det_dataset.py", line 15, in
from ..core.evaluation.hmean import evaluate_method
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/init.py", line 13, in
from .post_processing import BasePostDetector, TPPointsGeneration, PostMaskRCNN
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/init.py", line 14, in
from .post_east import PostEAST
File "/home/server/Desktop/ocr_piles/DAVAR-Lab-OCR/davarocr/davarocr/davar_det/core/post_processing/post_east.py", line 28, in
lib = ctl.load_library(lib_name, lib_dir)
File "/home/server/anaconda3/envs/otrpy37/lib/python3.7/site-packages/numpy/ctypeslib.py", line 153, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension

@EYcab
Copy link
Author

EYcab commented Sep 25, 2021

name: otrpy37
channels:

  • pytorch
  • conda-forge
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  • https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  • defaults
    dependencies:
  • _libgcc_mutex=0.1=main
  • _openmp_mutex=4.5=1_gnu
  • blas=1.0=mkl
  • bzip2=1.0.8=h7f98852_4
  • ca-certificates=2021.5.30=ha878542_0
  • certifi=2021.5.30=py37h89c1867_0
  • cudatoolkit=11.1.1=h6406543_8
  • ffmpeg=4.3=hf484d3e_0
  • freetype=2.10.4=h0708190_1
  • giflib=5.2.1=h36c2ea0_2
  • gmp=6.2.1=h58526e2_0
  • gnutls=3.6.13=h85f3911_1
  • intel-openmp=2021.3.0=h06a4308_3350
  • jpeg=9b=h024ee3a_2
  • lame=3.100=h7f98852_1001
  • lcms2=2.12=h3be6417_0
  • libedit=3.1.20210714=h7f8727e_0
  • libffi=3.2.1=hf484d3e_1007
  • libgcc-ng=9.3.0=h5101ec6_17
  • libgomp=9.3.0=h5101ec6_17
  • libiconv=1.16=h516909a_0
  • libpng=1.6.37=h21135ba_2
  • libstdcxx-ng=9.3.0=hd4cf53a_17
  • libtiff=4.1.0=h2733197_1
  • libuv=1.42.0=h7f98852_0
  • libwebp=1.2.0=h89dd481_0
  • lz4-c=1.9.3=h9c3ff4c_1
  • mkl=2021.3.0=h06a4308_520
  • mkl-service=2.4.0=py37h5e8e339_0
  • mkl_fft=1.3.0=py37h42c9631_2
  • mkl_random=1.2.2=py37h219a48f_0
  • ncurses=6.2=he6710b0_1
  • nettle=3.6=he412f7d_0
  • ninja=1.10.2=h4bd325d_0
  • olefile=0.46=pyh9f0ad1d_1
  • openh264=2.1.1=h780b84a_0
  • openssl=1.0.2u=h516909a_0
  • pip=21.2.2=py37h06a4308_0
  • python=3.7.0=h6e4f718_3
  • python_abi=3.7=2_cp37m
  • pytorch=1.8.0=py3.7_cuda11.1_cudnn8.0.5_0
  • readline=7.0=h7b6447c_5
  • setuptools=58.0.4=py37h06a4308_0
  • six=1.16.0=pyh6c4a22f_0
  • sqlite=3.33.0=h62c20be_0
  • tk=8.6.10=hbc83047_0
  • torchaudio=0.8.0=py37
  • torchvision=0.9.0=py37_cu111
  • typing_extensions=3.10.0.2=pyha770c72_0
  • wheel=0.37.0=pyhd3eb1b0_1
  • xz=5.2.5=h7b6447c_0
  • zlib=1.2.11=h7b6447c_3
  • zstd=1.4.9=ha95c52a_0
  • pip:
    • addict==2.4.0
    • albumentations==1.0.3
    • apted==1.0.3
    • attrs==21.2.0
    • beautifulsoup4==4.10.0
    • bs4==0.0.1
    • charset-normalizer==2.0.6
    • click==8.0.1
    • coverage==5.5
    • cycler==0.10.0
    • cython==0.29.24
    • davarocr==0.3.0
    • distance==0.1.3
    • editdistance==0.5.3
    • filelock==3.0.12
    • huggingface-hub==0.0.17
    • idna==3.2
    • imagecorruptions==1.1.2
    • imageio==2.9.0
    • imgaug==0.3.0
    • importlib-metadata==4.8.1
    • iniconfig==1.1.1
    • joblib==1.0.1
    • jsonlines==2.0.0
    • kiwisolver==1.3.2
    • levenshtein==0.15.0
    • lmdb==1.2.1
    • lxml==4.6.3
    • matplotlib==3.4.3
    • mmcv-full==1.3.4
    • mmdet==2.11.0
    • mmlvis==10.5.3
    • mmpycocotools==12.0.3
    • networkx==2.6.3
    • nltk==3.6.3
    • numpy==1.20.0
    • onnx==1.10.1
    • opencv-python==4.5.3.56
    • opencv-python-headless==4.5.3.56
    • packaging==21.0
    • pillow==6.2.2
    • pluggy==1.0.0
    • polygon3==3.0.9.1
    • prettytable==2.2.0
    • protobuf==3.18.0
    • py==1.10.0
    • pyclipper==1.3.0
    • pycocotools==2.0.2
    • pyparsing==2.4.7
    • pytest==6.2.5
    • pytest-cov==2.12.1
    • pytest-runner==5.3.1
    • python-dateutil==2.8.2
    • pywavelets==1.1.1
    • pyyaml==5.4.1
    • rapidfuzz==1.6.2
    • regex==2021.9.24
    • requests==2.26.0
    • sacremoses==0.0.45
    • scikit-image==0.18.3
    • scikit-learn==1.0
    • scipy==1.7.1
    • seqeval==1.2.2
    • shapely==1.7.1
    • sharedarray==3.2.1
    • sklearn==0.0
    • soupsieve==2.2.1
    • terminaltables==3.1.0
    • threadpoolctl==2.2.0
    • tifffile==2021.8.30
    • tokenizers==0.10.3
    • toml==0.10.2
    • tqdm==4.62.3
    • transformers==4.10.3
    • urllib3==1.26.7
    • wcwidth==0.2.5
    • yapf==0.31.0
    • zipp==3.5.0
      prefix: /home/server/anaconda3/envs/otrpy37

@EYcab
Copy link
Author

EYcab commented Sep 25, 2021

麻烦看看啊,我这个环境是刚刚搭的,然后直接用来测试你的
from davarocr.davar_common.apis import inference_model

@qiaoliang6
Copy link
Collaborator

ctypelib相关错误是由于没找到对应的so文件,davarocr会依赖一些有cpp编译得到的lib,例如DAVAR-Lab-OCR/davarocr/davar_det/datasets/pipelines/lib/east_data.so等。可以看一下环境中时候有这些文件。

它是由DAVAR-Lab-OCR/davarocr/setup.sh执行后自动编译得到的,不知道你安装时时候执行了DAVAR-Lab-OCR/setup.sh脚本。

@huyhoang17
Copy link

huyhoang17 commented Oct 5, 2021

@EYcab @qiaoliang6 Did you resolve this issue? I got the same error :/

@qiaoliang6
Copy link
Collaborator

@EYcab @qiaoliang6 Did you resolve this issue? I got the same error :/

Have you successfully run 'setup.sh' command, then there will be some '.so' files generated, such as '/davarocr/davar_det/core/post_processing/lib/east_postprocess.so', etc.

You can check whether there are ".so" files generated.

@qiaoliang6
Copy link
Collaborator

I have update the code to remove the global calling of post_east. It would not affect other algorithms.

@EYcab
Copy link
Author

EYcab commented Oct 11, 2021

@qiaoliang6,thank you for asking, I have solved that error by implementing setup.sh in davarocr which requires g++ pre-installation.

@EYcab EYcab closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants