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

【问题记录】AttributeError: module ‘numpy‘ has no attribute ‘bool‘

服务器上运行代码报错:

/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
Traceback (most recent call last):
File “main.py”, line 75, in
main()
File “main.py”, line 39, in main
runner.train()
File “/root/CLRNet-main/CLRNet-main/clrnet/engine/runner.py”, line 92, in train
self.train_epoch(epoch, train_loader)
File “/root/CLRNet-main/CLRNet-main/clrnet/engine/runner.py”, line 54, in train_epoch
for i, data in enumerate(train_loader):
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 517, in next
data = self._next_data()
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 1199, in _next_data
return self._process_data(data)
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 1225, in process_data
data.reraise()
File "/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils.py", line 429, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/utils/worker.py", line 202, in worker_loop
data = fetcher.fetch(index)
File "/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/conda/envs/clrnet/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/root/CLRNet-main/CLRNet-main/clrnet/datasets/base_dataset.py”, line 61, in getitem
sample = self.processes(sample)
File “/root/CLRNet-main/CLRNet-main/clrnet/datasets/process/process.py”, line 37, in call
data = t(data)
File “/root/CLRNet-main/CLRNet-main/clrnet/datasets/process/generate_lane_line.py”, line 188, in call
img, line_strings, seg = self.transform(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 2008, in call
return self.augment(*args, **kwargs)
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 1979, in augment
batch_aug = self.augment_batch
(batch, hooks=hooks)
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 641, in augment_batch

batch_inaug = self.augment_batch(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 3124, in augment_batch
batch = self[index].augment_batch
(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 641, in augment_batch

batch_inaug = self.augment_batch(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 3633, in augment_batch
batch_sub = augmenters.augment_batch
(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 641, in augment_batch

batch_inaug = self.augment_batch(
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 3395, in augment_batch
augmenter_active = self._get_augmenter_active(batch.nb_rows,
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py”, line 3368, in _get_augmenter_active
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
File “/opt/conda/envs/clrnet/lib/python3.8/site-packages/numpy/init.py”, line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module ‘numpy’ has no attribute ‘bool’.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
/opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)

报错一长串,就是说:这个错误是由于 numpy 库的一个变化导致的,具体来说,它指出 np.bool 已经被弃用,而应该使用内置的 bool 类型。

要解决这个问题,你可以尝试在你的代码中找到并替换所有的 np.bool,将其替换为 bool。你可以使用文本编辑器的查找和替换功能来执行这个操作。

但是我现在文件很多,一个个去改变形式不现实,可以用更换numpy版本。

numpy在1.24版本中放弃了bool的使用,将代码中np.bool改为np.bool_

或者将numpy版本降为1.23.1也可。(1.23.2也可以)

pip install numpy==1.23.1

相关文章:

【问题记录】AttributeError: module ‘numpy‘ has no attribute ‘bool‘

服务器上运行代码报错: /opt/conda/envs/clrnet/lib/python3.8/site-packages/imgaug-0.4.0-py3.8.egg/imgaug/augmenters/meta.py:3368: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. augmenter_active np.zeros((n…...

WordPress企业模板

首页大图wordpress外贸企业模板 橙色的wordpress企业模板 演示 https://www.zhanyes.com/waimao/6250.html...

Intel Quartus II IP之DP1.4 工程的创建与使用

前述: Win10电脑安装了Quartus 21.4,这可以满足绝大多数工程,特别是对于简单调用fifo/ram等的工程,但是想要学习Quartus的HDMI/DP等高速接口类IP,首先需要创建HDMI/DP IP的设计demo工程,此时还需要安装Ecl…...

k8s集群环境搭建以及插件安装

前置条件 终端工具MobaXterm很好用。 1、虚拟机三台(ip按自己的网络环境相应配置)(master/node) 节点ipk8s-master192.168.200.150k8s-node1192.168.200.151k8s-node2192.168.200.152 2、关闭防火墙(master/node) systemctl stop firewalld systemc…...

面试的那些事儿

先从面试来说 假如你是网申,你的简历必然会经过HR的筛选,一张简历HR可能也就花费10秒钟看一下,然后HR 就会决定你这一关是Fail还是Pass。 假如你是内推,如果你的简历没有什么优势的话,就算是内推你的人再用心&#x…...

ffmpeg音视频解码

ffmpeg音视频解码 一.编译ffmpeg1.安装vmware虚拟机2.vmware虚拟机安装linux操作系统3.安装ftp和fshell软件4.在Ubuntu(Linux)中编译Android平台的FFmpeg( arm和x86 )5.解压FFmpeg6.Android编译脚本(1)修改…...

uniapp uni.chooseLocation调用走失败那里,错误码:112

问题:我配置了百度上所有能配置的,一直调用不成功,如下图配置的 1:第一个 配置 代码: "permission": {"scope.userLocation": {"desc": "你的位置信息将用于小程序位置接口的效果展示"}…...

第一次开发基于SpringBoot的Java应用

第一次开发基于SpringBoot的Java应用 一、 方式1:IDEA创建New Project Spring Boot官方文档的Getting Started1、IDEA创建New Project2、Spring Boot官方文档的Getting Started2.1 Creating the POM (实际是,更新pom.xml)2.2 Add…...

回归预测 | Matlab实现MSADBO-CNN-LSTM基于改进蜣螂算法优化卷积神经网络-长短期记忆神经网络多特征回归预测

回归预测 | Matlab实现MSADBO-CNN-LSTM基于改进蜣螂算法优化卷积神经网络-长短期记忆神经网络多特征回归预测 目录 回归预测 | Matlab实现MSADBO-CNN-LSTM基于改进蜣螂算法优化卷积神经网络-长短期记忆神经网络多特征回归预测预测效果基本描述程序设计参考资料 预测效果 基本描…...

数据结构--排序

参考【算法】排序算法之希尔排序 - 知乎 (zhihu.com)https://zhuanlan.zhihu.com/p/122632213 1. 排序的定义 2. 插入排序 2.1 直接插入排序 在插入第i&#xff08;i>1)个记录时&#xff0c;前面的i-1个记录已经排好序 void insertSort(int r[],int n) {for(int i2;i<…...

Androidmanifest文件加固和对抗

前言 恶意软件为了不让我们很容易反编译一个apk&#xff0c;会对androidmanifest文件进行魔改加固&#xff0c;本文探索androidmanifest加固的常见手法以及对抗方法。这里提供一个恶意样本的androidmanifest.xml文件&#xff0c;我们学完之后可以动手实践。 1、Androidmanife…...

openssl3.2 - 官方demo学习 - cms - cms_denc.c

文章目录 openssl3.2 - 官方demo学习 - cms - cms_denc.c概述笔记END openssl3.2 - 官方demo学习 - cms - cms_denc.c 概述 将CMS数据结构写入PEM文件, 并将分离后的加密数据单独写到数据文件. 笔记 /*! \file cms_denc.c * \note openssl3.2 - 官方demo学习 - cms - cms_d…...

【Linux 命令】tree 对目录进行树形展示

目录 1、tree 命令功能展示 2、tree 命令安装 3、tree 命令语法及其参数功能 4、终止 tree 展开树命令 1、tree 命令功能展示 在 Linux 中&#xff0c;我们使用 ll 命令对目录的展示并不太方便我们查看&#xff0c;不太清晰明了&#xff0c;所以我们可以使用 tree 命令以…...

掌握Spring MVC拦截器整合技巧,实现灵活的请求处理与权限控制!

拦截器 1.1 拦截器概念1.2 拦截器入门案例1.2.1 环境准备1.2.2 拦截器开发步骤1:创建拦截器类步骤2:配置拦截器类步骤3:SpringMVC添加SpringMvcSupport包扫描步骤4:运行程序测试步骤5:修改拦截器拦截规则步骤6:简化SpringMvcSupport的编写 1.3 拦截器参数1.3.1 前置处理方法1.3…...

使用xbindkeys设置鼠标侧键

1.安装如下包 sudo apt install xbindkeys xautomation 2.生成配置文件 xbindkeys --defaults > $HOME/.xbindkeysrc 3.确定侧键键号 在终端执行下面的代码&#xff1a; xev | grep button 此时会出现如下窗口&#xff0c;将鼠标指针移动到这个窗口上&#xff1a; 单…...

跨站点请求伪造攻击 - Cross Site Request Forgery (CSRF)

什么是CSRF 最好理解CSRF攻击的方式是看一个具体的例子。 假设你的银行网站提供一个表单,允许当前登录用户将钱转账到另一个银行账户。例如,转账表单可能如下所示: <form method="post"action="/transfer"> <...

PLAN B KRYPTO ASSETS GMBH CO. KG 普兰资产管理公司

引领加密技术不断演进 PLAN B KRYPTO ASSETS普兰资产管理以其独创的「Trident Strategy三叉戟模型」技术为基础&#xff0c;持续推动加密技术的发展&#xff0c;打造 Schutz&#xff08;舒茨盾&#xff09; AI 金融隐私匿名公链。致力于提供高效的技术服务&#xff0c;基于机构…...

java接口和多态

1.接口 1.1黑马信息管理系统集合改进 (应用) 使用数组容器的弊端 容器长度是固定的&#xff0c;不能根据添加功能自动增长 没有提供用于赠删改查的方法 优化步骤 创建新的StudentDao类&#xff0c;OtherStudentDao 创建ArrayList集合容器对象 OtherStudentDao中的方法声明…...

C# 图解教程 第5版 —— 第22章 命名空间和程序集

文章目录 22.1 引用其他程序集22.2 命名空间22.2.1 命名空间名称22.2.2 命名空间的补充22.2.3 命名空间跨文件伸展22.2.4 嵌套命名空间 22.3 using 指令22.3.1 using 命名空间指令22.3.2 using 别名指令22.3.3 using static 指令 22.4 程序集的结构22.5 程序集标识符22.6 强命名…...

【Maven】008-Maven 私服搭建与使用

【Maven】008-Maven 私服搭建与使用 文章目录 【Maven】008-Maven 私服搭建与使用一、概述1、简介2、建立私服后依赖查找和下载逻辑第一步&#xff1a;请求本地仓库第二步&#xff1a;请求 Maven 私服第三步&#xff1a;请求外部远程仓库&#xff08;远程中央仓库等&#xff09…...

PHP和Node.js哪个更爽?

先说结论&#xff0c;rust完胜。 php&#xff1a;laravel&#xff0c;swoole&#xff0c;webman&#xff0c;最开始在苏宁的时候写了几年php&#xff0c;当时觉得php真的是世界上最好的语言&#xff0c;因为当初活在舒适圈里&#xff0c;不愿意跳出来&#xff0c;就好比当初活在…...

2025年能源电力系统与流体力学国际会议 (EPSFD 2025)

2025年能源电力系统与流体力学国际会议&#xff08;EPSFD 2025&#xff09;将于本年度在美丽的杭州盛大召开。作为全球能源、电力系统以及流体力学领域的顶级盛会&#xff0c;EPSFD 2025旨在为来自世界各地的科学家、工程师和研究人员提供一个展示最新研究成果、分享实践经验及…...

大语言模型如何处理长文本?常用文本分割技术详解

为什么需要文本分割? 引言:为什么需要文本分割?一、基础文本分割方法1. 按段落分割(Paragraph Splitting)2. 按句子分割(Sentence Splitting)二、高级文本分割策略3. 重叠分割(Sliding Window)4. 递归分割(Recursive Splitting)三、生产级工具推荐5. 使用LangChain的…...

Cloudflare 从 Nginx 到 Pingora:性能、效率与安全的全面升级

在互联网的快速发展中&#xff0c;高性能、高效率和高安全性的网络服务成为了各大互联网基础设施提供商的核心追求。Cloudflare 作为全球领先的互联网安全和基础设施公司&#xff0c;近期做出了一个重大技术决策&#xff1a;弃用长期使用的 Nginx&#xff0c;转而采用其内部开发…...

微服务商城-商品微服务

数据表 CREATE TABLE product (id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 商品id,cateid smallint(6) UNSIGNED NOT NULL DEFAULT 0 COMMENT 类别Id,name varchar(100) NOT NULL DEFAULT COMMENT 商品名称,subtitle varchar(200) NOT NULL DEFAULT COMMENT 商…...

selenium学习实战【Python爬虫】

selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...

Xen Server服务器释放磁盘空间

disk.sh #!/bin/bashcd /run/sr-mount/e54f0646-ae11-0457-b64f-eba4673b824c # 全部虚拟机物理磁盘文件存储 a$(ls -l | awk {print $NF} | cut -d. -f1) # 使用中的虚拟机物理磁盘文件 b$(xe vm-disk-list --multiple | grep uuid | awk {print $NF})printf "%s\n"…...

GitFlow 工作模式(详解)

今天再学项目的过程中遇到使用gitflow模式管理代码&#xff0c;因此进行学习并且发布关于gitflow的一些思考 Git与GitFlow模式 我们在写代码的时候通常会进行网上保存&#xff0c;无论是github还是gittee&#xff0c;都是一种基于git去保存代码的形式&#xff0c;这样保存代码…...

LabVIEW双光子成像系统技术

双光子成像技术的核心特性 双光子成像通过双低能量光子协同激发机制&#xff0c;展现出显著的技术优势&#xff1a; 深层组织穿透能力&#xff1a;适用于活体组织深度成像 高分辨率观测性能&#xff1a;满足微观结构的精细研究需求 低光毒性特点&#xff1a;减少对样本的损伤…...

MinIO Docker 部署:仅开放一个端口

MinIO Docker 部署:仅开放一个端口 在实际的服务器部署中,出于安全和管理的考虑,我们可能只能开放一个端口。MinIO 是一个高性能的对象存储服务,支持 Docker 部署,但默认情况下它需要两个端口:一个是 API 端口(用于存储和访问数据),另一个是控制台端口(用于管理界面…...