# Yolov7 training on custom data error

**URL:** <https://discuss.roboflow.com/t/yolov7-training-on-custom-data-error/4774>\
**Category:** 🤝  Community Help\
**Created:** [March 12, 2024, 10:27am UTC](https://discuss.roboflow.com/t/yolov7-training-on-custom-data-error/4774 "2024-03-12T10:27:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul-Razak\_Alhassan\_Gamani](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/abdul-razak_alhassan_gamani/32/3969_2.png) [@Abdul-Razak\_Alhassan\_Gamani](https://discuss.roboflow.com/u/Abdul-Razak_Alhassan_Gamani)\
**Post date:** [March 12, 2024, 10:27am UTC](https://discuss.roboflow.com/t/yolov7-training-on-custom-data-error/4774/1 "2024-03-12T10:27:34Z")

</div>

I am training yolov7 on my custom data annotated on roboflow in google colab. This is the tutorial that i am following: [Google Colab](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/train-yolov7-object-detection-on-custom-data.ipynb#scrollTo=1iqOPKjr22mL)

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](https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations). Did you mean: ‘inf’?

 ![yolov7_error](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/7/7f5e25f120654f774d6aecd04660aaef6fb63cfe.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [April 2, 2024, 10:28am UTC](https://discuss.roboflow.com/t/yolov7-training-on-custom-data-error/4774/2 "2024-04-02T10:28:15Z")

</div>

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