Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: array has an inhomogeneous shape after 1 dimensions #54

Open
dev2y opened this issue Feb 21, 2023 · 1 comment
Open

ValueError: array has an inhomogeneous shape after 1 dimensions #54

dev2y opened this issue Feb 21, 2023 · 1 comment

Comments

@dev2y
Copy link

dev2y commented Feb 21, 2023

Did any of you get this error?

python train.py --batch-size 32 --cfg cfg/yolov3-tiny.cfg --data data/coco.data --weights ''
Apex recommended for faster mixed precision training: https://github.com/NVIDIA/apex
Namespace(epochs=300, batch_size=32, cfg='cfg/yolov3-tiny.cfg', data='data/coco.data', multi_scale=False, img_size=[320, 640, 640], rect=False, resume=False, nosave=False, notest=False, evolve=False, bucket='', cache_images=False, weights='', name='', device='', adam=False, single_cls=False, freeze_layers=False)
Using CPU

Start Tensorboard with "tensorboard --logdir=runs", view at http://localhost:6006/
WARNING: smart bias initialization failure.
WARNING: smart bias initialization failure.
Model Summary: 37 layers, 8.85237e+06 parameters, 8.85237e+06 gradients
Optimizer groups: 13 .bias, 13 Conv2d.weight, 11 other
Reading image shapes: 100%|█████| 117264/117264 [00:06<00:00, 18844.44it/s]
Caching labels data/coco/trainvalno5k.txt (117264 found, 0 missing, 0 empty, 4514 duplicate, for 117264 images): 100%|██| 117264/117264 [00:11<00:00, 10099.37it/s]
Saving labels to /home/py/PyTorch-Spiking-YOLOv3/data/coco/labels/train2014.npy for faster future loading
Traceback (most recent call last):
  File "/home/py/PyTorch-Spiking-YOLOv3/train.py", line 435, in <module>
    train(hyp)  # train normally
  File "/home/py/PyTorch-Spiking-YOLOv3/train.py", line 194, in train
    dataset = LoadImagesAndLabels(train_path, img_size, batch_size,
  File "/home/py/PyTorch-Spiking-YOLOv3/utils/datasets.py", line 408, in __init__
    np.save(np_labels_path, self.labels)  # save for next time
  File "<__array_function__ internals>", line 200, in save
  File "/home/rcnn/pyenv/lib/python3.10/site-packages/numpy/lib/npyio.py", line 521, in save
    arr = np.asanyarray(arr)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (117264,) + inhomogeneous part.

@CXCxyz
Copy link

CXCxyz commented Apr 14, 2024

I've encountered the same issue.
How do you address this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants