YOLOv5运行train.py报错信息整理

文章讲述了如何处理三个常见的编程错误:numpy模块中int类型的替换、Windows环境下内存不足问题以及因版本不兼容导致的TypeError。解决方案包括修改代码中特定类型、调整训练参数和更新依赖包到指定版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、AttributeError: module 'numpy' has no attribute 'int'. `np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.

解决方法:将utils文件夹下面的datasets.py文件中的np.int 改为 int

2、OSError: [WinError 1455] 页面文件太小,无法完成操作。

解决方法:将train.py文件下“batch-size”的值调小,或者将“workers”的值设置为0。

3、TypeError: No loop matching the specified signature and casting was found for ufunc greater

问题的原因:依赖包版本不兼容。

解决方法:按照requirements.txt文件中依赖包的版本重新安装依赖包。

pip uninstall 依赖包的名称
pip install 依赖包的名称==指定的版本号

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值