ValueError: class_weight not supported for 3+ dimensional targets

在使用keras的class_weight参数的时候,设置class_weight为一个字典,报出这一样一个错误:

ValueError: `class_weight` not supported for 3+ dimensional targets

ValueError: class_weight not supported for 3+ dimensional targets_第1张图片

在尝试过很多方案后,仍没有成功解决,最后将class_weight字典改为一个numpy数组的时候成功解决!

公众号:

ValueError: class_weight not supported for 3+ dimensional targets_第2张图片

 

你可能感兴趣的:(深度学习,python,人工智能)