0

我将 keras.applications.Xception 用于多标签分类任务。我试图通过设置 classifier_activation='sigmoid' 并使用二元焦点损失设置损失函数来做到这一点。对于初始训练,我将 weights=None 设置为随机统一权重初始化,但我想在会话之间保存并恢复训练。

这是问题,当尝试使用 weights='best_weights.hdf5' 恢复训练时,出现错误(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/imagenet_utils.py #L430Only None and softmax activations are allowed for the classifier_activation argument when using pretrained weights, with include_top=True。所以,我只是activations.get('softmax')在第 427 行添加,问题似乎解决了。

  1. 忽略错误信息会有什么后果吗?
  2. 我收到错误是因为它们不适合用于多标签分类任务吗?还是它们仍然可以用于这些任务?(我训练了近 40 个 epoch 的 Xception,到目前为止看起来不错。)
4

0 回答 0