ray0809 / pix2pix Goto Github PK
View Code? Open in Web Editor NEWsimple pix2pix implement by keras
simple pix2pix implement by keras
Using TensorFlow backend.
Epochs 200
Bathc_size 12
Batches per epoch 31
Traceback (most recent call last):
File "new_pix2pix.py", line 252, in
train(200,12)
File "new_pix2pix.py", line 209, in train
discriminator = discriminator_model()
File "new_pix2pix.py", line 147, in discriminator_model
inputs = Input(shape=(img_cols,img_rows,IN_CH*2))
NameError: global name 'img_cols' is not defined
I am getting the above error ...
Can you please help resolve this issue.
sir ,
QUE 1 ) https://github.com/ray0809/pix2pix/blob/master/data.py needs image files (jpg and png) in folder /home/ray/python_code/keras_examples/pix2pix/CMP_facade_DB_base/base .
How can I get those ?
QUE 2 ) My understanding is that parameters of neural network are learnt when we have pair of files labelled as corresponding input and output . After training we give an unknown input image and neural network generates output image using parameters it has learnt earlier . Is that alright ?
That leads me to think that pic folder should have atleast 2 files (jpg , one input and one output)
Target folder can have 1 png file if we desire to predict the output for this input png image .
Is that ok ?
Will wait for your reply.
Thanks for reading.
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)
I cannot understand the format of *.npy, can u explain or push the files.
pic = np.load('pic.npy')
target = np.load('target.npy')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.