Tensorflow creating new variables despite reuse set to true

后端 未结 2 1239
暖寄归人
暖寄归人 2020-12-11 12:15

I am trying to build a basic RNN, but I get errors trying to use the network after training. I hold network architecture in a function inference



        
2条回答
  •  醉酒成梦
    2020-12-11 12:48

    @Patwie made the correct diagnosis regarding the error — a possible bug in the reference Keras implementation.

    However, in my opinion, the logical conclusion is not to dismiss Keras, but to use the Keras implementation that comes with tensorflow, that can be found in tf.keras. You will find that variables are generated correctly in this implementation. tf.keras is implemented specifically for tensorflow and should minimize this kind of interfacing error.

    In fact, if you are already tensorflow, I don't see any particular benefit in using the reference Keras rather than tf.keras, unless you are using its very latest features, tf.keras being typically a bit behind in terms of versions (e.g. currently at 2.1.5 in TF 1.8 wheras Keras 2.2.0 has been out for about a month).

提交回复
热议问题