Run demo.py on windows with cpu successfully!

本文详细介绍在Windows10环境下,使用Python3.6、TensorFlow1.3和VS2015,针对CTPN文本检测项目进行环境搭建的具体步骤。包括解决编译错误、更新C文件、构建setup文件、生成pyd文件以及必要的代码修改。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

my environment is:
windows10 ,
python3.6 ,
tensorflow1.3 ,
vs2015(ps:vs2013 not support python3.6 when compile)

step 1:make some change
change "np.int_t " to "np.intp_t" in line 25 of the file lib\utils\cython_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
execute:cython bbox.pyx
execute:cython cython_nms.pyx

step 3:builf 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("cython_nms.pyx"),include_dirs=[numpy_include])

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

step 5:make some change
(1) Set "USE_GPU_NMS " in the file \ctpn\text.yml as "False"
(2) Set the "_C.USE_GPU_NMS" in the file \lib\fast_rcnn\config.py as "False";
(3) Comment out the line "from lib.utils.gpu_nms import gpu_nms" in the file \lib\fast_rcnn\nms_wrapper.py;
(4) Comment out the line "from . import gpu_nms" in the file \lib\utils_init
.py;
(5) change "base_name = image_name.split('/')[-1]" to "base_name = image_name.split('\')[-1]" in line 24 of the file ctpn\demo.py

step 6:run demo
execute:cd your_dir\text-detection-ctpn-master
execute:python ./ctpn/demo.py

Processing /home/luli/DH-PTAM-master/pangolin Preparing metadata (setup.py) ... done Building wheels for collected packages: pangolin Building wheel for pangolin (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [41 lines of output] running bdist_wheel running build running build_py /home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() installing to build/bdist.linux-x86_64/wheel running install copying ./pangolin.cpython-38-x86_64-linux-gnu.so -> / Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/home/luli/DH-PTAM-master/pangolin/setup.py", line 30, in <module> setup( File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 183, in setup return run_commands(dist) File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 199, in run_commands dist.run_commands() File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands self.run_command(cmd) File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/command/bdist_wheel.py", line 461, in run self.egg2dist(self.egginfo_dir, distinfo_dir) File "/home/luli/anaconda3/envs/dhptam/lib/python3.8/site-packages/setuptools/command/bdist_wheel.py", line 590, in egg2dist raise ValueError(err) ValueError: Egg metadata expected at build/bdist.linux-x86_64/wheel/./pangolin-0.0.1-py3.8.egg-info but not found [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pangolin Running setup.py clean for pangolin Failed to build pangolin ERROR: Failed to build installable wheels for some pyproject.toml based projects (pangolin) (dhptam) luli@l
05-21
内容概要:文章详细介绍了ETL工程师这一职业,解释了ETL(Extract-Transform-Load)的概念及其在数据处理中的重要性。ETL工程师负责将分散、不统一的数据整合为有价值的信息,支持企业的决策分析。日常工作包括数据整合、存储管理、挖掘设计支持和多维分析展现。文中强调了ETL工程师所需的核心技能,如数据库知识、ETL工具使用、编程能力、业务理解能力和问题解决能力。此外,还盘点了常见的ETL工具,包括开源工具如Kettle、XXL-JOB、Oozie、Azkaban和海豚调度,以及企业级工具如TASKCTL和Moia Comtrol。最后,文章探讨了ETL工程师的职业发展路径,从初级到高级的技术晋升,以及向大数据工程师或数据产品经理的横向发展,并提供了学习资源和求职技巧。 适合人群:对数据处理感兴趣,尤其是希望从事数据工程领域的人士,如数据分析师、数据科学家、软件工程师等。 使用场景及目标:①了解ETL工程师的职责和技能要求;②选择适合自己的ETL工具;③规划ETL工程师的职业发展路径;④获取相关的学习资源和求职建议。 其他说明:随着大数据技术的发展和企业数字化转型的加速,ETL工程师的需求不断增加,尤其是在金融、零售、制造、人工智能、物联网和区块链等领域。数据隐私保护法规的完善也使得ETL工程师在数据安全和合规处理方面的作用更加重要。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值