Python 用户警告表Keras 2

Python 用户警告表Keras 2,python,python-3.x,tensorflow,keras,keras-2,Python,Python 3.x,Tensorflow,Keras,Keras 2,我试图复制工作,但收到以下警告: /usr/local/lib/python3.5/dist-packages/ipykernel_launcher.py:2: UserWarning: Update your `Model` call to the Keras 2 API: `Model(outputs=Tensor("de..., inputs=Tensor("in...)` 当我运行第84行时: model_final = Model(input = model.input, outpu

我试图复制工作,但收到以下警告:

/usr/local/lib/python3.5/dist-packages/ipykernel_launcher.py:2: UserWarning: Update your `Model` call to the Keras 2 API: `Model(outputs=Tensor("de..., inputs=Tensor("in...)`
当我运行第84行时:

model_final = Model(input = model.input, output = predictions)
我已安装以下软件包:

  • ipython==6.2.1
  • Keras==2.0.8
  • tensorflow==1.3.0
  • tensorflow张力板==0.1.5
代码似乎是用旧版本的Keras编写的,尽管在我的Keras版本下仍然可以工作

如有任何建议,将不胜感激

UserWarning: Update your `Model` call to the Keras 2 API:
`Model(inputs=[<tf.Tenso…, outputs=Tensor(“ma…)`
model = Model(input=[sentence_input, neg_input], output=loss)
因此,如果我们想消除这个警告,我们应该这样写:

model = Model(inputs=[sentence_input, neg_input], outputs=loss)
就一点点,就这样

model = Model(inputs=[sentence_input, neg_input], outputs=loss)