安装SEC,DSRG三维CRF时,问题:
ubuntu@fadfd17f190d:~/user_space/SGAN$ pip3 install CRF/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./CRF
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.5 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-6j6vk0ud/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-6j6vk0ud/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-req-build-6j6vk0ud/
Complete output (20 lines):
Error compiling Cython file:
------------------------------------------------------------
...
# distutils: sources = src/densecrf_wrapper.cpp
^
------------------------------------------------------------
krahenbuhl2013/wrapper.pyx:1:0: 'krahenbuhl2013/wrapper' is not a valid module name
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-6j6vk0ud/setup.py", line 32, in <module>
language="c++",
File "/usr/local/lib/python3.5/dist-packages/Cython/Build/Dependencies.py",line 1097, in cythonize
cythonize_one(*args)
File "/usr/local/lib/python3.5/dist-packages/Cython/Build/Dependencies.py",line 1220, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: krahenbuhl2013/wrapper.pyx
Compiling krahenbuhl2013/wrapper.pyx because it changed.
[1/1] Cythonizing krahenbuhl2013/wrapper.pyx
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check thelogs for full command output.
解决:将CRF/setup.py 修改:
setup(
name='CRF',
version=1.0,
packages=['krahenbuhl2013'],
ext_modules=cythonize(Extension(
#'krahenbuhl2013/wrapper',
'wrapper', //修改位置
sources=[
'krahenbuhl2013/wrapper.pyx',
"src/densecrf.cpp",
"src/labelcompatibility.cpp",
"src/pairwise.cpp",
"src/permutohedral.cpp",
"src/unary.cpp",
"src/util.cpp",
"src/densecrf_wrapper.cpp",
],
include_dirs=[
numpy.get_include(),
"include",
"/usr/include/eigen3",