我有一个Keras模型,其中CuDNNLSTM层在GPU上进行了训练,并保存在.h5
文件中。现在,我想使用命令model = load_model('model.h5')
在没有GPU的机器上加载该模型,并且出现此错误:
InvalidArgumentError: No OpKernel was registered to support Op 'CudnnRNN' used by node cu_dnnlstm/CudnnRNN (defined at <ipython-input-3-5ca26100f3d8>:5) with these attrs: [rnn_mode="lstm", seed2=0, is_training=true, dropout=0, seed=0, input_mode="linear_input", T=DT_FLOAT, direction="unidirectional"]
Registered devices: [CPU]
Registered kernels: <no registered kernels>
[[cu_dnnlstm/CudnnRNN]]
是否有一种方法可以加载此.h5
文件,而无需使用模型代码将CuDNNLSTM层转换为LSTM?