parap1uie-s / Keras-RFCN

RFCN implement based on Keras&Tensorflow
MIT License
72 stars 23 forks source link

error while training #3

Closed Lakshaysharma048 closed 6 years ago

Lakshaysharma048 commented 6 years ago

Hi @parap1uie-s ,

Can you please look into the error and tell why this is happening?

The error generated while training.

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/arraypad.py", line 1036, in _normalize_shape
    shape_arr = np.broadcast_to(shape_arr, (ndims, 2))
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/stride_tricks.py", line 173, in broadcast_to
    return _broadcast_to(array, shape, subok=subok, readonly=True)
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/stride_tricks.py", line 128, in _broadcast_to
    op_flags=[op_flag], itershape=shape, order='C').itviews[0]
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (3,2) and requested shape (2,2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/KerasRFCN/Data_generator.py", line 428, in data_generator
    load_image_gt(dataset, config, image_id, augment=augment)
  File "/home/ubuntu/KerasRFCN/Data_generator.py", line 39, in load_image_gt
    padding=config.IMAGE_PADDING)
  File "/home/ubuntu/KerasRFCN/Utils.py", line 405, in resize_image
    image = np.pad(image, padding, mode='constant', constant_values=0)
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/arraypad.py", line 1301, in pad
    pad_width = _validate_lengths(narray, pad_width)
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/arraypad.py", line 1080, in _validate_lengths
    normshp = _normalize_shape(narray, number_elements)
  File "/usr/local/lib/python3.5/dist-packages/numpy/lib/arraypad.py", line 1039, in _normalize_shape
    raise ValueError(fmt % (shape,))

Thanks.

parap1uie-s commented 6 years ago

I have checked the code, but there is everything ok in training. You may check your OwnDataset class, and load_image() function, including your image data. I'll leave this issue open, but won't fix anything right now.