今天在学习yolov5训练模型时,发生错误 AttributeError: module 'numpy' has no attribute 'int'
Traceback (most recent call last):
File "D:\yolov5\train.py", line 543, in <module>
train(hyp, opt, device, tb_writer)
File "D:\yolov5\train.py", line 189, in train
dataloader, dataset = create_dataloader(train_path, imgsz, batch_size, gs, opt,
File "D:\yolov5\utils\datasets.py", line 63, in create_dataloader
dataset = LoadImagesAndLabels(path, imgsz, batch_size,
File "D:\yolov5\utils\datasets.py", line 411, in __init__
bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index
File "D:\ProgramData\Anaconda3\envs\yolov5\lib\site-packages\numpy\__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'int'
在之前没有安装numpy,只是用CPU进行训练时未发生错误。今天换成GPU,安装numpy后在运行train.py就发生了该错误,不知道如何解决
提示发生错误的文件: