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: The two structures don't have the same sequence length. Input structure has length 0, while shallow structure has length 9. #17

Open
SalehShmali opened this issue Dec 24, 2020 · 3 comments

Comments

@SalehShmali
Copy link

SalehShmali commented Dec 24, 2020

can any one solve this issue please on training faster_rcnn_trainer.py

@ksyoon70
Copy link

ksyoon70 commented Feb 1, 2021

make virtual env with tensorflow version 2.1?
tf ver 2.4 makes errors like above.

@colindecourt
Copy link

Hi,
I changed the generator with the following function according to the tf2.4 documentation (https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit) and it seems it works with batch size of 1. For batch size > 1 there is another issue according to #14

def faster_rcnn_generator(dataset, anchors, hyper_params):
    """Tensorflow data generator for fit method, yielding inputs and outputs.
    inputs:
        dataset = tf.data.Dataset, PaddedBatchDataset
        anchors = (total_anchors, [y1, x1, y2, x2])
            these values in normalized format between [0, 1]
        hyper_params = dictionary
    outputs:
        yield inputs, outputs
    """
    while True:
        for image_data in dataset:
            img, gt_boxes, gt_labels = image_data
            bbox_deltas, bbox_labels = calculate_rpn_actual_outputs(anchors, gt_boxes, gt_labels, hyper_params)
            yield (img, gt_boxes, gt_labels, bbox_deltas, bbox_labels), 

@ruman1609
Copy link

Hi @colindecourt I encounter a error while doing with tensorflow 2.1 any idea how to handle that problem? I already open an issue #21. Feel free to drop by.

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

4 participants