"loss functions attached: %s", ", ".join(output_only))
if isinstance(loss, (list, tuple)):
loss = {x.get("target") : x for x in loss}
if not isinstance(loss, (dict, OrderedDict)):
raise ValueError("Loss functions given to "compile" should be "
"a list/tuple, a dictionary, or a single Loss instance. "
After Change
loss_with_names.append((x["target"], x))
elif isinstance(loss, (dict, OrderedDict)):
loss_with_names = list(loss.items())
else:
raise ValueError("Loss functions given to "compile" should be "
"a list/tuple, a dictionary, or a single Loss instance. "