Custom Keras Layer Troubles

后端 未结 1 665
孤街浪徒
孤街浪徒 2021-01-17 02:32

Hate to ask a question like this on machine learning but googling has yielded nothing useful - I\'ve just found 2 github threads where people on super old versions of tensor

相关标签:
1条回答
  • 2021-01-17 03:16

    You've added a weight self.kernel but didn't use it anywhere in your call function.

    Therefore, TF is unable to compute gradient for the parameters in self.kernel. In this case, the gradient will be None and that's why you're seeing an error complaining about operating on None values.

    Removing the line self.kernel = self.add_weight(...) should make it work.

    0 讨论(0)
提交回复
热议问题