Keras: difference of InputLayer and Input

前端 未结 2 2033
一整个雨季
一整个雨季 2021-02-08 06:38

I made a model using Keras with Tensorflow. I use Inputlayer with these lines of code:

img1 = tf.placeholder(tf.float32, shape=(None, img_width, i         


        
相关标签:
2条回答
  • 2021-02-08 06:53
    • InputLayer is a layer.
    • Input is a tensor.

    You can only call layers passing tensors to them.

    The idea is:

    outputTensor = SomeLayer(inputTensor)
    

    So, only Input can be passed because it's a tensor.

    Honestly, I have no idea about the reason for the existence of InputLayer. Maybe it's supposed to be used internally. I never used it, and it seems I'll never need it.

    0 讨论(0)
  • 2021-02-08 07:12

    According to tensorflow website, "It is generally recommend to use the functional layer API via Input, (which creates an InputLayer) without directly using InputLayer." Know more at this page here

    0 讨论(0)
提交回复
热议问题