2

I'm trying to reproduce this work but I receive the following warning:

/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...)`

when I run line 84:

model_final = Model(input = model.input, output = predictions)

I have the following packages installed:

  • ipython==6.2.1
  • Keras==2.0.8
  • tensorflow==1.3.0
  • tensorflow-tensorboard==0.1.5

It seems the code is written in an older version of Keras although still works under my version of Keras.

Any suggestion would be appreciated.

mrk
  • 8,059
  • 3
  • 56
  • 78
Borhan Kazimipour
  • 405
  • 1
  • 6
  • 13

1 Answers1

3
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)

Here we can see that the new api of keras, the input and output should be inputs and outputs.

The original code is:

model = Model(input=[sentence_input, neg_input], output=loss)

So if we want to get this warning away, we should write like this:

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

Just a little s here and there, that’s all.

mrk
  • 8,059
  • 3
  • 56
  • 78