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

training error #2

Open
sigmoidx opened this issue Nov 28, 2017 · 1 comment
Open

training error #2

sigmoidx opened this issue Nov 28, 2017 · 1 comment

Comments

@sigmoidx
Copy link

Hi, I have two errors during training.

1. error on G_loss.
--------------- Epoch 1 ---------------
0it [00:00, ?it/s]
Traceback (most recent call last):
File "new_pix2pix.py", line 255, in
train(200,12)
File "new_pix2pix.py", line 242, in train
G_loss.append(gloss)
UnboundLocalError: local variable 'gloss' referenced before assignment

So, I commented out G_loss and D_loss. And now it returns an another error
#G_loss.append(gloss)
#D_loss.append(dloss)
...
#D_loss = np.array(D_loss)
#G_loss = np.array(G_loss)
#np.save('Model_para/dloss.npy',D_loss)
#np.save('Model_para/gloss.npy',G_loss)

2. error on dimensions

--------------- Epoch 1 ---------------
0it [00:00, ?it/s]
Traceback (most recent call last):
File "new_pix2pix.py", line 255, in
train(200,12)
File "new_pix2pix.py", line 245, in train
generate_pic(generator,target[0:1],e)
File "new_pix2pix.py", line 187, in generate_pic
pic = generator.predict(target)
File "/home/marsha/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 1576, in predict
check_batch_axis=False)
File "/home/marsha/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 127, in _standardize_input_data
str(array.shape))
ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape (0, 1)

@ray0809
Copy link
Owner

ray0809 commented Nov 29, 2017

Hi,it seems that the data.npy has null.
Did you run the data.py before,if you have done,would you reload the npy file and check the format in it

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

2 participants