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

Predict Error #21

Open
ruman1609 opened this issue Mar 5, 2022 · 1 comment
Open

Predict Error #21

ruman1609 opened this issue Mar 5, 2022 · 1 comment

Comments

@ruman1609
Copy link

My code when I run model to predict causing an error

step_size = train_utils.get_step_size(test_total_item, batch_size)
pred_bboxes, pred_labels, pred_scores = frcnn_test_model.predict(test_data, steps=step_size, verbose=1)

here is the stacktrace:

TypeError                                 Traceback (most recent call last)
[<ipython-input-26-de9c8627623e>](https://localhost:8080/#) in <module>()
      1 step_size = train_utils.get_step_size(test_total_item, batch_size)
----> 2 pred_bboxes, pred_labels, pred_scores = frcnn_test_model.predict(test_data, steps=step_size, verbose=1)

[/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/autograph/impl/api.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    235       except Exception as e:  # pylint:disable=broad-except
    236         if hasattr(e, 'ag_error_metadata'):
--> 237           raise e.ag_error_metadata.to_exception(e)
    238         else:
    239           raise

TypeError: in converted code:

    /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/training_v2.py:677 map_fn
        batch_size=None)
    /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/training.py:2474 _standardize_tensors
        sample_weight, feed_output_names)
    /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/training_utils.py:639 standardize_sample_weights
        'sample_weight')
    /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/training_utils.py:629 standardize_sample_or_class_weights
        str(x_weight))

    TypeError: The model has multiple outputs, so `sample_weight` should be either a list or a dict. Provided `sample_weight` type not understood: Tensor("args_2:0", shape=(None, None), dtype=int32)
@ruman1609
Copy link
Author

as my counter step, with tensorflow 2.1, I downgrade it to 2.0. Maybe you guys have an idea to fix this in tensorflow version upper 2.0

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