TypeError: Unexpected keyword argument passed to optimizer: learning_rate

前端 未结 13 1651
故里飘歌
故里飘歌 2021-02-13 04:14

I am trying to load a Keras model which was trained on an Azure VM (NC promo). But I am getting the following error.

TypeError: Unexpected keyword argumen

13条回答
  •  误落风尘
    2021-02-13 04:44

    In my case I found the best solution is to use h5py to change name of the variable from "learning_rate" -> "lr" as suggested in the previous posts.

    import h5py
    data_p = f.attrs['training_config']
    data_p = data_p.decode().replace("learning_rate","lr").encode()
    f.attrs['training_config'] = data_p
    f.close()
    

提交回复
热议问题