当前位置: 首页 > news >正文

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编译文件出错

报错信息&#xff1a; (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&#xff0c;因为我觉得将复杂问题简单化是最好的 如何组件化开发 主窗口引用 <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 度。 你必须在 原地 旋转图像&#xff0c;这意味着你需要直接修改输入的二维矩阵。请不要 使用另一个矩阵来旋转图像。 2. 编程 矩阵转置&#xff1a; 遍历矩阵&#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)…...

户外运动盛行,运动品牌如何利用软文推广脱颖而出?

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

2024年孝感市建筑类中级职称申报资料私企VS国企

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

OpenResty安装

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

通过stream对list集合中对象的多个字段进行去重

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

招投标系统软件源码,招投标全流程在线化管理

功能描述 1、门户管理&#xff1a;所有用户可在门户页面查看所有的公告信息及相关的通知信息。主要板块包含&#xff1a;招标公告、非招标公告、系统通知、政策法规。 2、立项管理&#xff1a;企业用户可对需要采购的项目进行立项申请&#xff0c;并提交审批&#xff0c;查看所…...

css设置文本溢出隐藏...

在CSS中&#xff0c;文本溢出可以使用text-overflow属性来处理&#xff0c;下面分别介绍单行文本溢出和多行文本溢出的处理方法1&#xff1a; 单行文本溢出。需要使用text-overflow: ellipsis;来显示省略号。需要注意的是&#xff0c;为了兼容部分浏览器&#xff0c;还需要设置…...

【小尘送书-第八期】《小团队管理:如何轻松带出1+1>2的团队》

大家好&#xff0c;我是小尘&#xff0c;欢迎你的关注&#xff01;大家可以一起交流学习&#xff01;欢迎大家在CSDN后台私信我&#xff01;一起讨论学习&#xff0c;讨论如何找到满意的工作&#xff01; &#x1f468;‍&#x1f4bb;博主主页&#xff1a;小尘要自信 &#x1…...

【网络协议】聊聊ifconfig

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

python项目之AI动物识别工具的设计与实现(django)

项目介绍&#xff1a; &#x1f495;&#x1f495;作者&#xff1a;落落 &#x1f495;&#x1f495;个人简介&#xff1a;混迹java圈十余年&#xff0c;擅长Java、小程序、Python等。 &#x1f495;&#x1f495;各类成品java毕设 。javaweb&#xff0c;ssm&#xff0c;spring…...

全流量安全分析发现内部系统外联异常

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

Edge---微软浏览器-兼容性问题-解决办法(详细)

图片现象&#xff1a; 快捷键&#xff1a;winR &#xff08;进入管理员命令窗口&#xff09; 输入&#xff1a;regedit &#xff08;进入注册表编辑器&#xff09; 点击文件夹&#xff1a;HKEY_LOCAL_MACHINE 找到这个路径的文件项&#xff1a;HKEY_LOCAL_MACHINE\SOFTWARE…...

for循环遍历的`form表单组件`rules规则校验失效问题——下拉框选择之后还是报红---亲测有效

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

【Python数据分析工具】

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

Python数据挖掘入门进阶与实用案例:自动售货机销售数据分析与应用

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

2.3_9吸烟者问题

...

Vue记事本应用实现教程

文章目录 1. 项目介绍2. 开发环境准备3. 设计应用界面4. 创建Vue实例和数据模型5. 实现记事本功能5.1 添加新记事项5.2 删除记事项5.3 清空所有记事 6. 添加样式7. 功能扩展&#xff1a;显示创建时间8. 功能扩展&#xff1a;记事项搜索9. 完整代码10. Vue知识点解析10.1 数据绑…...

Xshell远程连接Kali(默认 | 私钥)Note版

前言:xshell远程连接&#xff0c;私钥连接和常规默认连接 任务一 开启ssh服务 service ssh status //查看ssh服务状态 service ssh start //开启ssh服务 update-rc.d ssh enable //开启自启动ssh服务 任务二 修改配置文件 vi /etc/ssh/ssh_config //第一…...

从零实现富文本编辑器#5-编辑器选区模型的状态结构表达

先前我们总结了浏览器选区模型的交互策略&#xff0c;并且实现了基本的选区操作&#xff0c;还调研了自绘选区的实现。那么相对的&#xff0c;我们还需要设计编辑器的选区表达&#xff0c;也可以称为模型选区。编辑器中应用变更时的操作范围&#xff0c;就是以模型选区为基准来…...

Oracle查询表空间大小

1 查询数据库中所有的表空间以及表空间所占空间的大小 SELECTtablespace_name,sum( bytes ) / 1024 / 1024 FROMdba_data_files GROUP BYtablespace_name; 2 Oracle查询表空间大小及每个表所占空间的大小 SELECTtablespace_name,file_id,file_name,round( bytes / ( 1024 …...

3.3.1_1 检错编码(奇偶校验码)

从这节课开始&#xff0c;我们会探讨数据链路层的差错控制功能&#xff0c;差错控制功能的主要目标是要发现并且解决一个帧内部的位错误&#xff0c;我们需要使用特殊的编码技术去发现帧内部的位错误&#xff0c;当我们发现位错误之后&#xff0c;通常来说有两种解决方案。第一…...

ESP32读取DHT11温湿度数据

芯片&#xff1a;ESP32 环境&#xff1a;Arduino 一、安装DHT11传感器库 红框的库&#xff0c;别安装错了 二、代码 注意&#xff0c;DATA口要连接在D15上 #include "DHT.h" // 包含DHT库#define DHTPIN 15 // 定义DHT11数据引脚连接到ESP32的GPIO15 #define D…...

[ICLR 2022]How Much Can CLIP Benefit Vision-and-Language Tasks?

论文网址&#xff1a;pdf 英文是纯手打的&#xff01;论文原文的summarizing and paraphrasing。可能会出现难以避免的拼写错误和语法错误&#xff0c;若有发现欢迎评论指正&#xff01;文章偏向于笔记&#xff0c;谨慎食用 目录 1. 心得 2. 论文逐段精读 2.1. Abstract 2…...

CocosCreator 之 JavaScript/TypeScript和Java的相互交互

引擎版本&#xff1a; 3.8.1 语言&#xff1a; JavaScript/TypeScript、C、Java 环境&#xff1a;Window 参考&#xff1a;Java原生反射机制 您好&#xff0c;我是鹤九日&#xff01; 回顾 在上篇文章中&#xff1a;CocosCreator Android项目接入UnityAds 广告SDK。 我们简单讲…...

浅谈不同二分算法的查找情况

二分算法原理比较简单&#xff0c;但是实际的算法模板却有很多&#xff0c;这一切都源于二分查找问题中的复杂情况和二分算法的边界处理&#xff0c;以下是博主对一些二分算法查找的情况分析。 需要说明的是&#xff0c;以下二分算法都是基于有序序列为升序有序的情况&#xf…...

LangChain知识库管理后端接口:数据库操作详解—— 构建本地知识库系统的基础《二》

这段 Python 代码是一个完整的 知识库数据库操作模块&#xff0c;用于对本地知识库系统中的知识库进行增删改查&#xff08;CRUD&#xff09;操作。它基于 SQLAlchemy ORM 框架 和一个自定义的装饰器 with_session 实现数据库会话管理。 &#x1f4d8; 一、整体功能概述 该模块…...