train_mixgan.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:MIX-plus-GAN 作者: yz-ignescent 项目源码 文件源码
def load_model(self, epoch):
        weights_toload = np.load(self.args.out_dir + '/Dweights_params_epoch{}.npz'.format(epoch))
        weights_list_toload = [weights_toload['arr_{}'.format(k)] for k in range(len(weights_toload.files))]
        LL.set_all_param_values(self.D_weights_layer, weights_list_toload)

        weights_toload = np.load(self.args.out_dir + '/Gweights_params_epoch{}.npz'.format(epoch))
        weights_list_toload = [weights_toload['arr_{}'.format(k)] for k in range(len(weights_toload.files))]
        LL.set_all_param_values(self.G_weights_layer, weights_list_toload)

        for i in range(self.args.ng):
            weights_toload = np.load(self.args.out_dir + '/disc%d_params_epoch%d.npz' % (i,epoch))
            weights_list_toload = [weights_toload['arr_{}'.format(k)] for k in range(len(weights_toload.files))]
            LL.set_all_param_values(self.D_layers[i], weights_list_toload)
            weights_toload = np.load(self.args.out_dir + '/gen%d_params_epoch%d.npz' % (i,epoch))
            weights_list_toload = [weights_toload['arr_{}'.format(k)] for k in range(len(weights_toload.files))]
            LL.set_all_param_values(self.G_layers[i], weights_list_toload)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号