Closed Kaido0 closed 7 years ago
I have solved this problem. 1.lambed shape——>'normal' 2.delete name:......
Changing to init='normal', and deleting name:... works for me.
I did just like you said, Changing to init='normal', and deleting name: but I got this: what's the problem?
python qlearn.py -m "Run"
Using TensorFlow backend.
Now we build the model
We finish building the model
Now we load weight
Traceback (most recent call last):
File "qlearn.py", line 198, in
I got that error as well. I believe it has to do with tensorflow/keras configuration,as the author pointed out: B) The ordering of the dimension is important, the default setting is 4x80x80 (Theano setting), so if your input is 80x80x4 (Tensorflow setting) then you are in trouble because the dimension is wrong. Alert: If your input dimension is 80x80x4 (Tensorflow setting) you need to set dim_ordering = tf (tf means tensorflow, th means theano)
Thank you so much! I will try that. :)
When I first write the program, I would like to initialize the neural network with a custom initialization
https://groups.google.com/forum/#!topic/keras-users/kc0Jsw1vTqY
But it seems the lambda function is no longer support in the latest version of the Keras.
I suggest you just remove the additional "lambda" statement and also delete the weight file and re-run the code.
python qlearn.py -m "Train"
It should work. I just test it.
I have fixed the code. You should able to run with Keras and tensorflow backend.
I trained the model with your old version on 12 March, it kept exploring after 420000 timesteps without any improvement visually. I'll try the new one.
Yes please try the new code. I now default everything to tensorflow (as Keras default tensorflow too), and I also amend the learning rate to 1e-4, so it should converge in approx 400k frame. I also change the code so that it won't use up all your GPU memory (should roughly take 500MB max)
On Tue, Mar 14, 2017 at 7:16 PM, Weijia Chen notifications@github.com wrote:
I trained the model with your old version on 12 March, it kept exploring after 420000 timesteps without visually improvement. I'll try the new one.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/yanpanlau/Keras-FlappyBird/issues/9#issuecomment-286391681, or mute the thread https://github.com/notifications/unsubscribe-auth/AO1sY3yQ7pw41Pp49rPPGt8P6OdKpm4hks5rlncYgaJpZM4MS8H2 .
This is my first time run this code,and I got the error. Keras=1.2.2 using theano backend.
I do not know how to solve this problem~
libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Using Theano backend. Now we build the model Traceback (most recent call last): File "qlearn.py", line 198, in
main()
File "qlearn.py", line 195, in main
playGame(args)
File "qlearn.py", line 188, in playGame
model = buildmodel()
File "qlearn.py", line 44, in buildmodel
model.add(Convolution2D(32, 8, 8, subsample=(4,4),init=lambda shape, name: normal(shape, scale=0.01, name=name), border_mode='same',input_shape=(img_channels,img_rows,img_cols)))
File "/home/kaido/anaconda2/lib/python2.7/site-packages/keras/models.py", line 299, in add
layer.create_input_layer(batch_input_shape, input_dtype)
File "/home/kaido/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 401, in create_input_layer
self(x)
File "/home/kaido/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 546, in call
self.build(input_shapes[0])
File "/home/kaido/anaconda2/lib/python2.7/site-packages/keras/layers/convolutional.py", line 436, in build
constraint=self.W_constraint)
File "/home/kaido/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 418, in add_weight
weight = initializer(shape, name=name)
TypeError: () got an unexpected keyword argument 'dim_ordering'