Before the new update, if all the output layers are named and in graph model, calling predict(X) will return a dictionary. The new API seems can only return a list of prediction. Will the predict be able to output dictionary in the future? There are some inconsistence because the fit() function can take in "y" as a dict while the predict() cannot. Thanks!
Please make sure that the boxes below are checked before you submit your issue. Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.
If you have named your output layers this code should convert predictions to a dictionary:
p = model.predict(x)
p = {out.name.split(':')[0]: p[i] for i, out in enumerate(model.outputs)}
@AntonOsika But is the order of the predictions in the list p
ensured to be the order of the pairs in the dictionary passed to the loss and metrics? Dictionaries do not necessarily ensure that the order of the elements is constant.
Most helpful comment
If you have named your output layers this code should convert predictions to a dictionary: