Wenn die folgende Methode aufrufen:Tensorflow Valueerror: Nur `Anruf mit benannten Argumenten sparse_softmax_cross_entropy_with_logits`
losses = [tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels)
for logits, labels in zip(logits_series,labels_series)]
Ich erhalte die folgende Valueerror:
ValueError: Only call `sparse_softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)
Dagegen:
[tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels)
Gemäß der Dokumentation für nn_ops.py Ich muss sicherstellen, dass die Anmeldungen und Etiketten zu etwas initialisiert z.B .:
def _ensure_xent_args(name, sentinel, labels, logits): # Make sure that all arguments were passed as named arguments. if sentinel is not None: raise ValueError("Only call
%s
with " "named arguments (labels=..., logits=..., ...)" % name) if labels is None or logits is None: raise ValueError("Both labels and logits must be provided.")Logits=X, labels =Y
Was ist die Ursache hier ist? Und initialisiere ich sie auf einen Wert wie den Verlust? Oder?
fand ich ein ähnliches Problem hier: https://stackoverflow.com/questions/45038024/tensorflow-valueerror-only-call-sparse-softmax-cross-entropy-with-logits-with – Glennismade
was habe ich um Tensorflow explizit zu nennen, was die Logits und Labels sind? – Glennismade