Yolov7 training on custom data error

I am training yolov7 on my custom data annotated on roboflow in google colab. This is the tutorial that i am following: Google Colab

Traceback (most recent call last):
File “/content/yolov7/train.py”, line 616, in
train(hyp, opt, device, tb_writer)
File “/content/yolov7/train.py”, line 289, in train
model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) * nc # attach class weights
File “/content/yolov7/utils/general.py”, line 222, in labels_to_class_weights
classes = labels[:, 0].astype(np.int) # labels = [class xywh]
File “/usr/local/lib/python3.10/dist-packages/numpy/init.py”, line 319, in getattr
raise AttributeError(former_attrs[attr])
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.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
NumPy 1.20.0 Release Notes — NumPy v2.1.dev0 Manual. Did you mean: ‘inf’?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.