当前位置: 首页 > 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…...

嵌入式工程师技术成长路径:从单片机到Linux驱动开发

嵌入式工程师职业发展路径的技术思考1. 职业发展阶段与技术演进1.1 单片机开发阶段对于刚毕业的电子工程专业学生&#xff0c;单片机开发通常是职业起点。这一阶段主要涉及&#xff1a;8/16/32位微控制器(如STM32系列)的应用开发基础外设驱动开发(GPIO、UART、SPI、I2C等)实时操…...

ST7565SPI嵌入式LCD驱动库:轻量、可移植、零内存分配

1. ST7565SPI 驱动库概述ST7565 是 Sitronix 公司推出的单芯片图形点阵 LCD 控制器&#xff0c;广泛应用于工业人机界面、便携式仪器仪表、智能穿戴设备等对功耗、成本与显示质量有综合要求的嵌入式场景。其典型分辨率为 12864 像素&#xff0c;内置 12864 bit 显示 RAM&#x…...

保姆级避坑指南:Ubuntu系统下Hadoop HA集群搭建,我踩过的那些SSH和配置文件的“坑”

Ubuntu下Hadoop HA集群搭建&#xff1a;那些教科书不会告诉你的实战陷阱 第一次在Ubuntu上搭建Hadoop HA集群时&#xff0c;我天真地以为照着官方文档就能顺利跑起来。直到SSH连接莫名其妙失败、JournalNode权限报错刷屏、ZKFC死活不启动时&#xff0c;才明白为什么有人说大数据…...

R语言新手必看:clusterProfiler功能富集分析从安装到实战(附常见报错解决方案)

R语言实战&#xff1a;clusterProfiler功能富集分析全流程指南 第一次接触功能富集分析时&#xff0c;我被那些密密麻麻的基因列表和复杂的生物学术语搞得晕头转向。直到发现了clusterProfiler这个神器&#xff0c;它就像生物信息学分析中的瑞士军刀&#xff0c;把复杂的富集过…...

告别编译踩坑:详解GMP交叉编译中DESTDIR和.la文件的那些‘坑’与正确用法

告别编译踩坑&#xff1a;详解GMP交叉编译中DESTDIR和.la文件的那些‘坑’与正确用法 交叉编译是嵌入式开发和跨平台构建中的常见需求&#xff0c;但其中隐藏的陷阱往往让开发者头疼不已。特别是像GMP这样的基础数学库&#xff0c;一旦编译或部署环节出现问题&#xff0c;可能导…...

Easy-Scraper:Rust 构建的现代化网页数据采集解决方案

Easy-Scraper&#xff1a;Rust 构建的现代化网页数据采集解决方案 【免费下载链接】easy-scraper Easy scraping library 项目地址: https://gitcode.com/gh_mirrors/ea/easy-scraper 在数据驱动决策的时代&#xff0c;网页数据采集已成为企业获取市场情报、研究人员收集…...

Llama-3.2-3B效果体验:Ollama简单操作,产出专业级文案

Llama-3.2-3B效果体验&#xff1a;Ollama简单操作&#xff0c;产出专业级文案 1. 模型概览&#xff1a;小而精的文本生成专家 Llama-3.2-3B是Meta最新推出的轻量级语言模型&#xff0c;在3B参数规模下实现了接近大模型的文本生成质量。经过指令微调优化后&#xff0c;它在多语…...

用Python+Control库实现倒立摆LQR控制:从建模到仿真全流程

用PythonControl库实现倒立摆LQR控制&#xff1a;从建模到仿真全流程 倒立摆问题一直是控制理论中的经典案例&#xff0c;它不仅能帮助我们理解线性二次调节器&#xff08;LQR&#xff09;的核心思想&#xff0c;还能锻炼我们解决实际工程问题的能力。本文将带你从零开始&#…...

猫抓浏览器插件:网页资源嗅探与下载的终极解决方案

猫抓浏览器插件&#xff1a;网页资源嗅探与下载的终极解决方案 【免费下载链接】cat-catch 猫抓 chrome资源嗅探扩展 项目地址: https://gitcode.com/GitHub_Trending/ca/cat-catch 你是否曾在浏览网页时&#xff0c;看到精彩的视频、音频或图片资源&#xff0c;却苦于无…...

Pixel Fashion Atelier保姆级教程:如何将生成结果无缝导入Aseprite进行二次编辑

Pixel Fashion Atelier保姆级教程&#xff1a;如何将生成结果无缝导入Aseprite进行二次编辑 1. 教程概述 Pixel Fashion Atelier是一款基于Stable Diffusion与Anything-v5的像素风格图像生成工具&#xff0c;特别适合创作复古RPG风格的时尚设计。本教程将手把手教你如何将生成…...