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 when building #19

Open
davideCremona opened this issue Aug 17, 2020 · 1 comment
Open

ValueError when building #19

davideCremona opened this issue Aug 17, 2020 · 1 comment

Comments

@davideCremona
Copy link

Hi, I'm experimenting with your repository but the training stops with error, raising this exception:

File "/home/davidecremona/PycharmProjects/Mobilenet-ssd-keras/training/drb_train_mobilenet_ssd.py", line 262, in <module>
    train(args)
  File "/home/davidecremona/PycharmProjects/Mobilenet-ssd-keras/training/drb_train_mobilenet_ssd.py", line 242, in train
    callbacks=callbacks
  File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1418, in fit_generator
    initial_epoch=initial_epoch)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py", line 181, in fit_generator
    generator_output = next(output_generator)
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 709, in get
    six.reraise(*sys.exc_info())
  File "/home/davidecremona/.local/lib/python3.6/site-packages/six.py", line 703, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 685, in get
    inputs = self.queue.get(block=True).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 670, in get
    raise self._value
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 626, in next_sample
    return six.next(_SHARED_SEQUENCES[uid])
  File "/home/davidecremona/PycharmProjects/Mobilenet-ssd-keras/misc/ssd_batch_generator.py", line 1325, in generate
    batch_y_true = ssd_box_encoder.encode_y(batch_y, diagnostics=False) # Encode the labels into the `y_true` tensor that the SSD loss function needs.
  File "/home/davidecremona/PycharmProjects/Mobilenet-ssd-keras/misc/ssd_box_encode_decode_utils.py", line 929, in encode_y
    y_encode_template = self.generate_encode_template(batch_size=len(ground_truth_labels), diagnostics=False)
  File "/home/davidecremona/PycharmProjects/Mobilenet-ssd-keras/misc/ssd_box_encode_decode_utils.py", line 874, in generate_encode_template
    boxes_tensor = np.concatenate(boxes_batch, axis=1)
  File "<__array_function__ internals>", line 6, in concatenate

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 2, the array at index 0 has size 19 and the array at index 1 has size 10

Process finished with exit code 1

Can you please give me some hint in what I'm doing wrong?

Thanks,
Davide.

@davideCremona
Copy link
Author

After printing that "boxes_batch" when the exception occurs, I see this:

[array([], shape=(0, 19, 19, 4, 4), dtype=float64), array([], shape=(0, 10, 10, 6, 4), dtype=float64), array([], shape=(0, 5, 5, 6, 4), dtype=float64), array([], shape=(0, 3, 3, 6, 4), dtype=float64), array([], shape=(0, 2, 2, 4, 4), dtype=float64), array([], shape=(0, 1, 1, 4, 4), dtype=float64)]

Is it correct?

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

1 participant