最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to set non-trainable weights? - Stack Overflow

programmeradmin0浏览0评论

The method keras.Model.set_weights seems to only take trainable weights. Non-trainable weights such as those from normalization layers cannot be imported this way. This is problematic, since in Keras with JAX backend, we can only perform stateless operations. That is; update the weights separate from the model. Therefore, before saving a model using keras.Model.save, it is required to load in the weights. However, since non-trainable weights cannot be loaded in (and therefore not saved in the .keras format), the saved model will underperform.

Is it possible to load/set the non-trainable weights in a Keras model? More generally, is there any way to save the complete model, including non-trainable weights when using JAX as backend?

发布评论

评论列表(0)

  1. 暂无评论