Cython编译文件出错
报错信息:
(rpc) stu@amax:~/segment/dss_crf$ python setup.py install
Compiling pydensecrf/eigen.pyx because it changed.
Compiling pydensecrf/densecrf.pyx because it changed.
[1/2] Cythonizing pydensecrf/densecrf.pyx
/home/stu/anaconda3/envs/rpc/lib/python3.6/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/stu03/kdy/rpc/segment/dss_crf/pydensecrf/densecrf.pxdtree = Parsing.p_module(s, pxd, full_module_name)Error compiling Cython file:
------------------------------------------------------------
...
from eigen cimport *
^
------------------------------------------------------------pydensecrf/densecrf.pxd:1:0: 'eigen.pxd' not foundError compiling Cython file:
------------------------------------------------------------
...cdef cppclass PottsCompatibility(LabelCompatibility):PottsCompatibility(float) except +cdef cppclass DiagonalCompatibility(LabelCompatibility):DiagonalCompatibility(const c_VectorXf&) except +^
------------------------------------------------------------pydensecrf/densecrf.pxd:12:36: 'c_VectorXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...cdef cppclass DiagonalCompatibility(LabelCompatibility):DiagonalCompatibility(const c_VectorXf&) except +cdef cppclass MatrixCompatibility(LabelCompatibility):MatrixCompatibility(const c_MatrixXf&) except +^
------------------------------------------------------------pydensecrf/densecrf.pxd:15:34: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...
cdef extern from "densecrf/include/unary.h":cdef cppclass UnaryEnergy:passcdef cppclass ConstUnaryEnergy(UnaryEnergy):ConstUnaryEnergy(const c_MatrixXf& unary) except +^
------------------------------------------------------------pydensecrf/densecrf.pxd:23:31: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...cdef cppclass ConstUnaryEnergy(UnaryEnergy):ConstUnaryEnergy(const c_MatrixXf& unary) except +cdef cppclass LogisticUnaryEnergy(UnaryEnergy):LogisticUnaryEnergy(const c_MatrixXf& L, const c_MatrixXf& feature) except +^
------------------------------------------------------------pydensecrf/densecrf.pxd:26:34: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...cdef cppclass ConstUnaryEnergy(UnaryEnergy):ConstUnaryEnergy(const c_MatrixXf& unary) except +cdef cppclass LogisticUnaryEnergy(UnaryEnergy):LogisticUnaryEnergy(const c_MatrixXf& L, const c_MatrixXf& feature) except +^
------------------------------------------------------------pydensecrf/densecrf.pxd:26:55: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...c_DenseCRF(int N, int M) except +# Setup methods.# TODO#void addPairwiseEnergy(PairwisePotential *potential)void addPairwiseEnergy(const c_MatrixXf &features, LabelCompatibility*, KernelType, NormalizationType)^
------------------------------------------------------------pydensecrf/densecrf.pxd:54:37: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# Setup methods.# TODO#void addPairwiseEnergy(PairwisePotential *potential)void addPairwiseEnergy(const c_MatrixXf &features, LabelCompatibility*, KernelType, NormalizationType)void setUnaryEnergy(UnaryEnergy *unary)void setUnaryEnergy(const c_MatrixXf &unary)^
------------------------------------------------------------pydensecrf/densecrf.pxd:56:34: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# TODO#void addPairwiseEnergy(PairwisePotential *potential)void addPairwiseEnergy(const c_MatrixXf &features, LabelCompatibility*, KernelType, NormalizationType)void setUnaryEnergy(UnaryEnergy *unary)void setUnaryEnergy(const c_MatrixXf &unary)void setUnaryEnergy(const c_MatrixXf &L, const c_MatrixXf &feature)^
------------------------------------------------------------pydensecrf/densecrf.pxd:57:34: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# TODO#void addPairwiseEnergy(PairwisePotential *potential)void addPairwiseEnergy(const c_MatrixXf &features, LabelCompatibility*, KernelType, NormalizationType)void setUnaryEnergy(UnaryEnergy *unary)void setUnaryEnergy(const c_MatrixXf &unary)void setUnaryEnergy(const c_MatrixXf &L, const c_MatrixXf &feature)^
------------------------------------------------------------pydensecrf/densecrf.pxd:57:55: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...void setUnaryEnergy(UnaryEnergy *unary)void setUnaryEnergy(const c_MatrixXf &unary)void setUnaryEnergy(const c_MatrixXf &L, const c_MatrixXf &feature)# Inference methods.c_MatrixXf inference(int n_iterations)^
------------------------------------------------------------pydensecrf/densecrf.pxd:60:8: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...c_MatrixXf inference(int n_iterations)# TODO: Not enabled because it would require wrapping VectorXs (note the `s`)#c_VectorXs map(int n_iterations)# Step-by-step inference methods.c_MatrixXf startInference() const^
------------------------------------------------------------pydensecrf/densecrf.pxd:65:8: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# TODO: Not enabled because it would require wrapping VectorXs (note the `s`)#c_VectorXs map(int n_iterations)# Step-by-step inference methods.c_MatrixXf startInference() constvoid stepInference(c_MatrixXf &Q, c_MatrixXf &tmp1, c_MatrixXf &tmp2) const^
------------------------------------------------------------pydensecrf/densecrf.pxd:66:27: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# TODO: Not enabled because it would require wrapping VectorXs (note the `s`)#c_VectorXs map(int n_iterations)# Step-by-step inference methods.c_MatrixXf startInference() constvoid stepInference(c_MatrixXf &Q, c_MatrixXf &tmp1, c_MatrixXf &tmp2) const^
------------------------------------------------------------pydensecrf/densecrf.pxd:66:42: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# TODO: Not enabled because it would require wrapping VectorXs (note the `s`)#c_VectorXs map(int n_iterations)# Step-by-step inference methods.c_MatrixXf startInference() constvoid stepInference(c_MatrixXf &Q, c_MatrixXf &tmp1, c_MatrixXf &tmp2) const^
------------------------------------------------------------pydensecrf/densecrf.pxd:66:60: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...# Step-by-step inference methods.c_MatrixXf startInference() constvoid stepInference(c_MatrixXf &Q, c_MatrixXf &tmp1, c_MatrixXf &tmp2) const#double gradient( int n_iterations, const ObjectiveFunction & objective, c_VectorXf * unary_grad, c_VectorXf * lbl_cmp_grad, c_VectorXf * kernel_grad=NULL ) const;double klDivergence(const c_MatrixXf &Q) const^
------------------------------------------------------------pydensecrf/densecrf.pxd:69:34: 'c_MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...return eigen.MatrixXf().wrap(self._this.inference(niter))def startInference(self):return eigen.MatrixXf().wrap(self._this.startInference()), eigen.MatrixXf(), eigen.MatrixXf()def stepInference(self, MatrixXf Q, MatrixXf tmp1, MatrixXf tmp2):^
------------------------------------------------------------pydensecrf/densecrf.pyx:85:28: 'MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...return eigen.MatrixXf().wrap(self._this.inference(niter))def startInference(self):return eigen.MatrixXf().wrap(self._this.startInference()), eigen.MatrixXf(), eigen.MatrixXf()def stepInference(self, MatrixXf Q, MatrixXf tmp1, MatrixXf tmp2):^
------------------------------------------------------------pydensecrf/densecrf.pyx:85:40: 'MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...return eigen.MatrixXf().wrap(self._this.inference(niter))def startInference(self):return eigen.MatrixXf().wrap(self._this.startInference()), eigen.MatrixXf(), eigen.MatrixXf()def stepInference(self, MatrixXf Q, MatrixXf tmp1, MatrixXf tmp2):^
------------------------------------------------------------pydensecrf/densecrf.pyx:85:55: 'MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...return eigen.MatrixXf().wrap(self._this.startInference()), eigen.MatrixXf(), eigen.MatrixXf()def stepInference(self, MatrixXf Q, MatrixXf tmp1, MatrixXf tmp2):self._this.stepInference(Q.m, tmp1.m, tmp2.m)def klDivergence(self, MatrixXf Q):^
------------------------------------------------------------pydensecrf/densecrf.pyx:88:27: 'MatrixXf' is not a type identifierError compiling Cython file:
------------------------------------------------------------
...def addPairwiseEnergy(self, float[:,::1] features not None, compat, KernelType kernel=DIAG_KERNEL, NormalizationType normalization=NORMALIZE_SYMMETRIC):self._this.addPairwiseEnergy(eigen.c_matrixXf(features), _labelcomp(compat), kernel, normalization)def setUnary(self, Unary u):self._this.setUnaryEnergy(u.move())^
------------------------------------------------------------pydensecrf/densecrf.pyx:71:33: ambiguous overloaded method
Traceback (most recent call last):File "setup.py", line 16, in <module>ext_modules=cythonize(['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx']),File "/home/stu/anaconda3/envs/rpc/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonizecythonize_one(*args)File "/home/stu/anaconda3/envs/rpc/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_oneraise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pydensecrf/densecrf.pyx
(rpc) stu@amax:~/segment/dss_crf$
解决方法:
(1)尝试从该目录中删除__init__.py
。由于某些原因,它在尝试编译时混淆了cython。
(2)考虑使用pyximport扩展名: import pyximport; pyximport.install()
,然后import your_module
(好像是一个normal.py),如果您只想从普通python文件导入.pyx文件。
注意:在第一种情况下,__init__.py
不必删除。
相关文章:
Cython编译文件出错
报错信息: (rpc) stuamax:~/segment/dss_crf$ python setup.py install Compiling pydensecrf/eigen.pyx because it changed. Compiling pydensecrf/densecrf.pyx because it changed. [1/2] Cythonizing pydensecrf/densecrf.pyx /home/stu/anaconda3/envs/rpc/l…...

WPF 用户控件依赖注入赋值
前言 我一直想组件化得去开发WPF,因为我觉得将复杂问题简单化是最好的 如何组件化开发 主窗口引用 <Window x:Class"WpfApp1.MainWindow"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x"http://schemas.…...

leetcode-48.旋转图像
1. 题目 leetcode题目链接 给定一个 n n 的二维矩阵 matrix 表示一个图像。请你将图像顺时针旋转 90 度。 你必须在 原地 旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要 使用另一个矩阵来旋转图像。 2. 编程 矩阵转置: 遍历矩阵&#x…...

antd的RangePicker设置默认值,默认近七天(andt+react)
import moment from "moment";state {initData:[moment().startOf(day).subtract(6, d), moment().endOf(day)], }<FormItem label"产生时间" {...tailItemLayout}>{getFieldDecorator("produceTime", {initialValue: initData})(<Ran…...

大数据可视化模块竞赛Vue项目文件结构与注意事项
1.vue项目src目录下只有两个文件夹与两个js文件,如图所示: 2.asseets目录存放包或其他外部资料 注意 :echarts采用的是引用外部文件导入 let echarts = require(@/assets/echarts.min.js) 3.components目录存放绘制页面的vue文件(我这里示例创建了一个newPage.vue)…...

户外运动盛行,运动品牌如何利用软文推广脱颖而出?
全民健康意识的提升和城市居民对亲近自然的渴望带来户外运动的盛行,这也使运动品牌的市场保持强劲发展势头,那么在激烈的市场竞争中,运动品牌应该如何脱颖而出呢?下面就让媒介盒子告诉你! 一、 分享户外运动干货 用户…...

2024年孝感市建筑类中级职称申报资料私企VS国企
2024年孝感市建筑类中级职称申报资料私企VS国企 民营企业中级职称申报跟事业单位或者是国企申报中级职称流程不一样么?实际上流程基本都是相同的,就是提交纸质版资料有点不一样。 孝感市建筑类中级职称申报基本流程 1.参加建筑类中级职称水平能力测试。 …...

OpenResty安装
OpenResty 是一个基于 Nginx 的 Web 平台,它将 Nginx 和 Lua 脚本语言结合起来,提供了更强大的 Web 应用开发和部署能力。OpenResty 仓库是 OpenResty 项目的官方仓库,包含了 OpenResty 的源代码、文档、示例等资源。 OpenResty 仓库地址是&…...

通过stream对list集合中对象的多个字段进行去重
记录下通过stream流对list集合中对象的多个字段进行去重! 举个栗子,对象book,我们要通过姓名和价格这两个字段的值进行去重,该这么做呢? distinct()返回由该流的不同元素组成的流。distinct&am…...

招投标系统软件源码,招投标全流程在线化管理
功能描述 1、门户管理:所有用户可在门户页面查看所有的公告信息及相关的通知信息。主要板块包含:招标公告、非招标公告、系统通知、政策法规。 2、立项管理:企业用户可对需要采购的项目进行立项申请,并提交审批,查看所…...
css设置文本溢出隐藏...
在CSS中,文本溢出可以使用text-overflow属性来处理,下面分别介绍单行文本溢出和多行文本溢出的处理方法1: 单行文本溢出。需要使用text-overflow: ellipsis;来显示省略号。需要注意的是,为了兼容部分浏览器,还需要设置…...

【小尘送书-第八期】《小团队管理:如何轻松带出1+1>2的团队》
大家好,我是小尘,欢迎你的关注!大家可以一起交流学习!欢迎大家在CSDN后台私信我!一起讨论学习,讨论如何找到满意的工作! 👨💻博主主页:小尘要自信 …...

【网络协议】聊聊ifconfig
我们知道在linux是ifconfig查看ip地址,但是ip addr也可以查看 IP 地址是一个网卡在网络世界的通讯地址,相当于我们现实世界的门牌号码。 从IP地址的划分来看,C类地址只可以容纳254个,而B类6W多,那么又没有一种折中的…...

python项目之AI动物识别工具的设计与实现(django)
项目介绍: 💕💕作者:落落 💕💕个人简介:混迹java圈十余年,擅长Java、小程序、Python等。 💕💕各类成品java毕设 。javaweb,ssm,spring…...

全流量安全分析发现内部系统外联异常
内部系统外连监控的重要性在于保护企业的信息安全和预防数据泄露,以下是几个重要的理由: 1、检测异常活动:通过监控内部系统的外连连接,可以及时发现是否有未经授权或异常的链接尝试。这可能表示存在恶意软件、黑客攻击或内部员工…...

Edge---微软浏览器-兼容性问题-解决办法(详细)
图片现象: 快捷键:winR (进入管理员命令窗口) 输入:regedit (进入注册表编辑器) 点击文件夹:HKEY_LOCAL_MACHINE 找到这个路径的文件项:HKEY_LOCAL_MACHINE\SOFTWARE…...

for循环遍历的`form表单组件`rules规则校验失效问题——下拉框选择之后还是报红---亲测有效
问题: 大概的效果就是这种, for循环选择之后还是还是报红 看文章之前 : 先检查 model rules pops 有没有判定好 解决: 参考了他的 for循环遍历的form表单组件rules规则校验失效问题——输入内容后依然提示必填,亲测有效——基础积累_a-form-model的validat…...

【Python数据分析工具】
文章目录 概要整体架构流程技术名词解释 概要 数据分析是一种通过收集、处理、分析和解释大量数据,以发现有价值信息、洞察趋势、制定决策并解决问题的过程。在现代科技和互联网的推动下,数据分析变得日益重要。它不仅仅是对数字和图表的简单解释&#…...

Python数据挖掘入门进阶与实用案例:自动售货机销售数据分析与应用
文章目录 写在前面01 案例背景02 分析目标03 分析过程04 数据预处理1. 清洗数据2.属性选择3.属性规约 05 销售数据可视化分析1.销售额和自动售货机数量的关系2.订单数量和自动售货机数量的关系3.畅销和滞销商品4.自动售货机的销售情况5.订单支付方式占比6.各消费时段的订单用户…...

2.3_9吸烟者问题
...
Python爬虫实战:研究MechanicalSoup库相关技术
一、MechanicalSoup 库概述 1.1 库简介 MechanicalSoup 是一个 Python 库,专为自动化交互网站而设计。它结合了 requests 的 HTTP 请求能力和 BeautifulSoup 的 HTML 解析能力,提供了直观的 API,让我们可以像人类用户一样浏览网页、填写表单和提交请求。 1.2 主要功能特点…...
React hook之useRef
React useRef 详解 useRef 是 React 提供的一个 Hook,用于在函数组件中创建可变的引用对象。它在 React 开发中有多种重要用途,下面我将全面详细地介绍它的特性和用法。 基本概念 1. 创建 ref const refContainer useRef(initialValue);initialValu…...
Java 8 Stream API 入门到实践详解
一、告别 for 循环! 传统痛点: Java 8 之前,集合操作离不开冗长的 for 循环和匿名类。例如,过滤列表中的偶数: List<Integer> list Arrays.asList(1, 2, 3, 4, 5); List<Integer> evens new ArrayList…...
TRS收益互换:跨境资本流动的金融创新工具与系统化解决方案
一、TRS收益互换的本质与业务逻辑 (一)概念解析 TRS(Total Return Swap)收益互换是一种金融衍生工具,指交易双方约定在未来一定期限内,基于特定资产或指数的表现进行现金流交换的协议。其核心特征包括&am…...

04-初识css
一、css样式引入 1.1.内部样式 <div style"width: 100px;"></div>1.2.外部样式 1.2.1.外部样式1 <style>.aa {width: 100px;} </style> <div class"aa"></div>1.2.2.外部样式2 <!-- rel内表面引入的是style样…...

学习STC51单片机32(芯片为STC89C52RCRC)OLED显示屏2
每日一言 今天的每一份坚持,都是在为未来积攒底气。 案例:OLED显示一个A 这边观察到一个点,怎么雪花了就是都是乱七八糟的占满了屏幕。。 解释 : 如果代码里信号切换太快(比如 SDA 刚变,SCL 立刻变&#…...
腾讯云V3签名
想要接入腾讯云的Api,必然先按其文档计算出所要求的签名。 之前也调用过腾讯云的接口,但总是卡在签名这一步,最后放弃选择SDK,这次终于自己代码实现。 可能腾讯云翻新了接口文档,现在阅读起来,清晰了很多&…...

Windows安装Miniconda
一、下载 https://www.anaconda.com/download/success 二、安装 三、配置镜像源 Anaconda/Miniconda pip 配置清华镜像源_anaconda配置清华源-CSDN博客 四、常用操作命令 Anaconda/Miniconda 基本操作命令_miniconda创建环境命令-CSDN博客...

【网络安全】开源系统getshell漏洞挖掘
审计过程: 在入口文件admin/index.php中: 用户可以通过m,c,a等参数控制加载的文件和方法,在app/system/entrance.php中存在重点代码: 当M_TYPE system并且M_MODULE include时,会设置常量PATH_OWN_FILE为PATH_APP.M_T…...

脑机新手指南(七):OpenBCI_GUI:从环境搭建到数据可视化(上)
一、OpenBCI_GUI 项目概述 (一)项目背景与目标 OpenBCI 是一个开源的脑电信号采集硬件平台,其配套的 OpenBCI_GUI 则是专为该硬件设计的图形化界面工具。对于研究人员、开发者和学生而言,首次接触 OpenBCI 设备时,往…...