WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.23k stars 4.18k forks source link

issue with training #1537

Open romz01 opened 1 year ago

romz01 commented 1 year ago

Hi everyone ! I have some issues when i try to train yolov7 in my conda environnement.

I get this message error :

Transferred 552/566 items from yolov7.pt Scaled weight_decay = 0.001 Optimizer groups: 95 .bias, 95 conv.weight, 98 other train: Scanning 'data/train/labels.cache' images and labels... 155 found, 2 missing, 0 empty, 0 corrupted: 100%|███████████████████████████████████████████████████████████████████████| 157/157 [00:00<?, ?it/s] val: Scanning 'data/val/labels.cache' images and labels... 23 found, 4 missing, 0 empty, 0 corrupted: 100%|██████████████████████████████████████████████████████████████████████████████| 27/27 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/romain/yolov7/train.py", line 616, in train(hyp, opt, device, tb_writer) File "/home/romain/yolov7/train.py", line 268, in train tb_writer.add_histogram('classes', c, 0) File "/home/romain/anaconda3/envs/yolov7/lib/python3.9/site-packages/torch/utils/tensorboard/writer.py", line 485, in add_histogram histogram(tag, values, bins, max_bins=max_bins), global_step, walltime File "/home/romain/anaconda3/envs/yolov7/lib/python3.9/site-packages/torch/utils/tensorboard/summary.py", line 358, in histogram hist = make_histogram(values.astype(float), bins, max_bins) File "/home/romain/anaconda3/envs/yolov7/lib/python3.9/site-packages/torch/utils/tensorboard/summary.py", line 386, in make_histogram cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32)) TypeError: No loop matching the specified signature and casting was found for ufunc greater

I check on forum and web but i don't found anything to help, somebody have an idea ?

Thanks a lot !

KingTerminatora commented 1 year ago

hello! May I ask you to solve the problem?

Cjy66666 commented 1 year ago

Your numpy version is not suitable, just modify the version to 1.23.5

viethoang303 commented 1 year ago

I also get this error and I don't know why it occurs, but I delete folder miniconda and install miniconda again, it worked

KingTerminatora commented 1 year ago

I found a new solution, just delete dtype=np.int32 in cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))

curtis18 commented 1 year ago

Your numpy version is not suitable, just modify the version to 1.23.5

Yes, version 1.25.1 does have the same issue and switch back to 1.23.5.

NowLoadY commented 1 year ago

I found a new solution, just delete dtype=np.int32 in cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))

confirmed, it works :)

sreeja-01p commented 4 months ago

I found a new solution, just delete dtype=np.int32 in cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))

in which file? I can't find it in train.py but I am getting the exact above error