Keras: difference of InputLayer and Input

前端 未结 2 2030
一整个雨季
一整个雨季 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条回答
  •  闹比i
    闹比i (楼主)
    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.

提交回复
热议问题