Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view_generative_model.py fail to generate animation #40

Open
longjie opened this issue Jan 23, 2017 · 5 comments
Open

view_generative_model.py fail to generate animation #40

longjie opened this issue Jan 23, 2017 · 5 comments

Comments

@longjie
Copy link

longjie commented Jan 23, 2017

Hi,

I have successfully trained the transition model.
Now I'm going to generate the gif of the predicted image.
I followed instructions:

$ ./server.py --time 60 --batch 64
$ ./view_generative_model.py transition --name transition

I got an error:

loading weights...
Traceback (most recent call last):
  File "./view_generative_model.py", line 71, in <module>
    x = X.reshape((sh[0], args.time, 80, 160, 3))
ValueError: cannot reshape array of size 147456000 into shape (64,1,80,160,3)

I thought I may need to make the input size matched, I add time and batch options as:

$ ./view_generative_model.py transition --name transition --batch 64 --time 60

I got another error:

loading weights...
Sampling...
  0%|                                                   | 0/128 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "./view_generative_model.py", line 83, in <module>
    code = sess.run([E_out[0]], feed_dict={I: x, K.learning_phase(): 1})[0]
  File "/home/tajima/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
    run_metadata_ptr)
  File "/home/tajima/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 943, in _run
    % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (3840, 80, 160, 3) for Tensor u'transition/input_1:0', which has shape '(960, 80, 160, 3)'

How can I make it work?

@zhaobaozi
Copy link

hi.i meet the same problem,have you solve it ?thanks

@yangyuekai
Copy link

Hello.I have the same question with you.Do you solve it?Thank you very much.It will be better if you could help me to solve it.

@Ling-wei
Copy link

Hi, I have solved this problem by using the following instructions:
$ ./server.py --time 15 --batch 7 $ ./view_generative_model.py --name transition --time 15 --batch 7
You can have a try.

@yangyuekai
Copy link

oh.I have tried it.But,there is a warning: ValueError:Cannot feed value of shape(35,512)for Tensor u'transition/dense_input_1:0',which has shape '(98,512)'.So,did you have changed code ? It is hepld me very much.Thanks!

@Ling-wei
Copy link

@yangyuekai
Hi, I didn't change the code from github. I guess your problem from this command( line 87 ) imgs = sess.run([G_out], feed_dict={O: outs.reshape((-1, z_dim)), K.learning_phase(): 1})[0]
The shape of G_out is (98,512) and the feed_dict which is the output of transition model should also be like this. You can check if something wrong when training the transition model because when I ran the command ./view_generative_model.py transition --time 15 --batch 7
the screen output T.shape: (7, 14, 512), maybe your model made some mistake and had a wrong output just like T.shape: (7, 5, 512)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants