Python 已释放TensorFlow.js有状态SimpleRN Tensor

Python 已释放TensorFlow.js有状态SimpleRN Tensor,python,tensorflow,machine-learning,tensorflow.js,Python,Tensorflow,Machine Learning,Tensorflow.js,我正在尝试创建一个有状态的RNN模型。我可以调用predict一次,然后其他调用会给我一个错误:uncaughterror:Tensor被释放。 我的模型声明如下: 函数createModel(){ const inputGame=tf.input({ batchShape:[1,1,输出形状], 名称:'inputGame', }); 常量inputPlayer=tf.input({ batchShape:[1,1,输入\玩家], 名称:“inputPlayer”, }); 常量输入=tf.

我正在尝试创建一个有状态的RNN模型。我可以调用predict一次,然后其他调用会给我一个错误:
uncaughterror:Tensor被释放。

我的模型声明如下:

函数createModel(){
const inputGame=tf.input({
batchShape:[1,1,输出形状],
名称:'inputGame',
});
常量inputPlayer=tf.input({
batchShape:[1,1,输入\玩家],
名称:“inputPlayer”,
});
常量输入=tf.layers
.concatenate({name:'concatenate'})
.apply([inputGame,inputPlayer]);
常量rnn=tf.layers.simpleRN({
单位:128,
激活:“relu”,
有状态的:是的,
内核初始化程序:“glorotNormal”,
Biasinizializer:“glorotNormal”,
名称:'rnn',
});
常数密度=tf.layers.density({
单位:输出_形,
激活:“乙状结肠”,
内核初始化程序:“glorotNormal”,
Biasinizializer:“glorotNormal”,
名称:'稠密',
});
常量输出=稠密的.apply(rnn.apply(输入));
const model=tf.model({输入:[inputGame,inputPlayer],输出:[output]});
const surface={name:'Model Summary',tab:'Model Inspection'};
tfvis.show.modelSummary(曲面、模型);
收益模型;
}
然后我每秒钟打一次电话:

constinputgametensor=tf.tensor(帧);
const inputPlayerTensor=tf.zeros([1,1,INPUT_PLAYER]);
const output=model.predict([inputGameTensor,InputPlayerSensor],true);
我怀疑在
SimpleRNN
层中有一个
state
张量,在调用predict一次后,它就被
disposed()
。我不太了解TensorFlow.js来研究这个假设

我的代码运行在:

你能不能做一个正在抛出错误的工作片段?发现错误和提供帮助会更容易。我无法让它在那里工作。相反,我使用了gh页面