Skip to content

Running with CPU only #43

Open
Open
@zhao181

Description

@zhao181

Hello everyone, it is the first time I could successfully run a demo. Many thanks to the author.

To use cpu only, I follow the author's instruction and make the following modifications:
(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) To rebuild the setup.py:

The author provides the new code of setup.py for cpu only:

from Cython.Build import cythonize
import numpy as np
from distutils.core import setup

try:
numpy_include = np.get_include()
except AttributeError:
numpy_include = np.get_numpy_include()

setup(
ext_modules=cythonize(["bbox.pyx","cython_nms.pyx"],include_dirs=[numpy_include]),
)

(a) execute export CFLAGS=-I/home/zhao181/ProGram1/anaconda2/lib/python2.7/site-packages/numpy/core/include
you should use your own numpy path.

(b) cd xxx/text-detection-ctpn-master/lib/utils
and execute:python setup.py build

(c) copy the .so file from the "build" directory to the
xxx/text-detection-ctpn-master/lib/utils.

(5) cd xxx/text-detection-ctpn-master
and execute: python ./ctpn/demo.py

By the way, I am running under ubuntu 16.04 with
Anaconda2-4.2.0-Linux-x86_64.sh and tensorflow-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl(cpu).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions