text-detection-ctpn icon indicating copy to clipboard operation
text-detection-ctpn copied to clipboard

run demo successfully!(在windows下成功运行demo.py)

Open loooong opened this issue 6 years ago • 16 comments

I mainly follow issue#73 with some changes. my environment is: windows10 , python3.7 , tensorflow1.13 , vs2019

step 1:make some change change "np.int_t " to "np.intp_t" in line 25 of the file lib\utils\bbox\nms.pyx otherwise appear " ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long' " in step 6.

step 2:updata c file execute:cd your_dir\text-detection-ctpn-master\lib\utils\bbox execute:cython bbox.pyx execute:cython nms.pyx

step 3:create setup file as setup_new.py import numpy as np from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension numpy_include = np.get_include() setup(ext_modules=cythonize("bbox.pyx"),include_dirs=[numpy_include]) setup(ext_modules=cythonize("nms.pyx"),include_dirs=[numpy_include])

step 4:build .pyd file execute:python setup_new.py install copy bbox/build/bbox.cp36-win_amd64.pyd and cython_nms.cp36-win_amd64.pyd to your_dir\text-detection-ctpn-master\lib\utils\bbox step 5:run demo execute:cd your_dir\text-detection-ctpn-master execute:python ./ctpn/demo.py

loooong avatar May 15 '19 02:05 loooong

楼主的这个可以用于 text-detection-ctpn-banjin-dev 分支,修改对应的文件名称就可以了

cvnli avatar May 16 '19 01:05 cvnli

写的很好,不过这是什么原理呢

SeniorCtrlPlayer avatar May 21 '19 14:05 SeniorCtrlPlayer

太棒了,搞定

00helloworld avatar May 24 '19 12:05 00helloworld

While I run step 4, I got this error

$ python setup_new.py install running install running build running build_ext building 'lib.utils.bbox' extension error: Unable to find vcvarsall.bat

My machine is windows 10, does anyone have clue about this?

MulongXie avatar Jul 20 '19 04:07 MulongXie

While I run step 4, I got this error

$ python setup_new.py install

running install running build running build_ext building 'lib.utils.bbox' extension error: Unable to find vcvarsall.bat My machine is windows 10, does anyone have clue about this?

your vs need to support c++ compile

tryrus avatar Jul 21 '19 04:07 tryrus

run demo.py successfully on the environment: windows10, anaconda python3.5, tensorflow1.14, vs2015

tryrus avatar Jul 21 '19 06:07 tryrus

when i come to step 4 'python setup_new.py install', it came up with ''error: don't know how to compile C/C++ code on platform 'nt' with 'mingw32.exe' compiler'',any help?

little7Li avatar Jul 29 '19 11:07 little7Li

While I run step 4, I got this error

$ python setup_new.py install

running install running build running build_ext building 'lib.utils.bbox' extension error: Unable to find vcvarsall.bat My machine is windows 10, does anyone have clue about this

You just need to install MS Build 2017. it should work because cython needs a compiler

khaoula96 avatar Aug 15 '19 19:08 khaoula96

image

hello, i got this problem. my environment is: win10 python3.6 tensorflow 1.8

i build the cpu version following the top topic. by these command:

enter 'ctpn\lib\utils' cython .\bbox.pyx cython .\cython_nms.pyx python .\setup_new.py install copy the 'cython_nms.cp36-win_amd64.pyd' and 'bbox.cp36-win_amd64.pyd' to the 'ctpn\lib\utils' run '.\ctpn\demon.py'

how to solve this problem, thank you very much.

abovegrd avatar Sep 29 '19 07:09 abovegrd

Regarding the above issue, I solved it by modifying the encoding of config file text.yml.

abovegrd avatar Oct 14 '19 00:10 abovegrd

'NoneType' object has no attribute 'model_checkpoint_path' how to fix this question

Ffmydy avatar Nov 07 '19 12:11 Ffmydy

'NoneType' object has no attribute 'model_checkpoint_path' how to fix this question

i mat same problem in line 73, in main model_path = os.path.join(FLAGS.checkpoint_path, os.path.basename(ckpt_state.model_checkpoint_path))

ghost avatar Nov 29 '19 02:11 ghost

While I run step 4, I got this error

$ python setup_new.py install

running install running build running build_ext building 'lib.utils.bbox' extension error: Unable to find vcvarsall.bat My machine is windows 10, does anyone have clue about this?

If u have visual studio in your system just install "Desktop Development With C++" which will create vcvarsall.bat file.

sonuagarwal1008 avatar Dec 03 '19 10:12 sonuagarwal1008

@Ffmydy I met the same problem. Have you solved it?

VictorYang097 avatar Feb 03 '20 10:02 VictorYang097

Thanks, nice! win10, python3.5.2, tensorflow1.4.0,vs2015。cython0.24

Hudaiguo avatar Feb 27 '20 08:02 Hudaiguo

hi, I have followed the above operation ,but why i run demo.py it will occur this problem image this is my Contents image

KKDDD avatar Apr 15 '20 08:04 KKDDD