InvalidArgumentError while using Keras backend function

157
May 01, 2018, at 01:09 AM

I am using Keras backend function to compute the gradient in reinforcement learning set up and following is the snippet of code. For this code, I am getting an error which is below as well. What could be the reason for it?

        X = K.placeholder(shape=(None, 32, 32, 3)) 
        train_fxn = K.function([X], [], updates=updates)
        X = self.states[0].reshape(1, 32, 32, 3)
        train_fxn([X])

Error is

       InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'sequential_2_input_1' with dtype float and shape [?,32,32,3]
     [[Node: sequential_2_input_1 = Placeholder[dtype=DT_FLOAT, shape=[?,32,32,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
Answer 1

It’s complaining that the vector you supplied is either not the right shape or contains values other than floats.

You passed in a value of None to the vertex on Line 1 which may be causing the error.

READ ALSO
Get github users public email id using their github name [on hold]

Get github users public email id using their github name [on hold]

I am using the urllib library to get the source of the github webpage of different usersBut when i am trying to scrap for their public emails

115
Annotating interactive plot with images on mouse-click in python

Annotating interactive plot with images on mouse-click in python

I've been trying to find a way to display an image on a python plot, with the image corresponding to the position of the mouse clickHere's where I'm up to: Annotated plot (needs an image instead of text)

90
Find and write to next blank cell in a column

Find and write to next blank cell in a column

I need to find and write to next blank cell

74
Splitting a string from right at intervals in python

Splitting a string from right at intervals in python

I'm trying to split a string from the rightFollowing is the code

90