Version control 在chainer5中转换列参数

Version control 在chainer5中转换列参数,version-control,autoencoder,chainer,Version Control,Autoencoder,Chainer,如何更改此训练参数(旧版本代码)并在培训师扩展中使用此参数。在Chainer:5.4.0中使用此代码需要做哪些必要的更改 ValueError: train argument is not supported anymore. Use chainer.using_config [AutoEncoder/stackedautocoder/Regression.py]() [Train.py]() 在错误中,它指出了两个不同的部分: 1.optimizer.update(模型,x,y) 2.为下

如何更改此训练参数(旧版本代码)并在培训师扩展中使用此参数。在Chainer:5.4.0中使用此代码需要做哪些必要的更改

ValueError: train argument is not supported anymore. Use 
chainer.using_config
[AutoEncoder/stackedautocoder/Regression.py]()

[Train.py]()

在错误中,它指出了两个不同的部分: 1.optimizer.update(模型,x,y) 2.为下一层第二行准备列车数据,这些数据与每层中的节点数量不匹配。下面给出了错误代码

InvalidType: 
Invalid operation is performed in: LinearFunction (Forward)

Expect: prod(in_types[0].shape[1:]) == in_types[1].shape[1]
Actual: 784 != 250

关于列车参数,详情如下:

train参数由v1中的dropout使用,但现在Chainer使用config来管理其阶段:是否在训练中。 因此,有两件事要做。 首先,从脚本中删除序列参数。 第二,在上下文中移动推理代码

with chainer.using_config(‘train’, False):
    # define the inference process
为下一层第二行准备列车数据,这些数据与每层中的节点数量不匹配


您能分享错误信息吗?

关于训练参数,详细信息写在这里:

train参数由v1中的dropout使用,但现在Chainer使用config来管理其阶段:是否在训练中。 因此,有两件事要做。 首先,从脚本中删除序列参数。 第二,在上下文中移动推理代码

with chainer.using_config(‘train’, False):
    # define the inference process
为下一层第二行准备列车数据,这些数据与每层中的节点数量不匹配


您能分享错误信息吗?

我编辑了问题以添加不匹配的错误信息…我编辑了问题以添加不匹配的错误信息。。。