Comments (4)
Hi @MrtnStnwk,
Thank you for your find, I will update the model right away.
from cyclegan-keras.
There seems to be another (minor) issue here. If the number of samples is not dividable by the batch_size, it jams after an epoch. (e.g. following: batch size 4, no samples 6287).
Traceback (most recent call last):
File "model.py", line 924, in <module>
GAN = CycleGAN()
File "model.py", line 243, in __init__
self.train(epochs=self.epochs, batch_size=self.batch_size, save_interval=self.save_interval)
File "model.py", line 608, in train
run_training_iteration(loop_index, epoch_iterations)
File "model.py", line 407, in run_training_iteration
DB_loss_real = self.D_B.train_on_batch(x=real_images_B, y=ones)
File "/home/m.steenwijk/miniconda2/lib/python2.7/site-packages/keras/engine/training.py", line 1211, in train_on_batch
class_weight=class_weight)
File "/home/m.steenwijk/miniconda2/lib/python2.7/site-packages/keras/engine/training.py", line 804, in _standardize_user_data
check_array_length_consistency(x, y, sample_weights)
File "/home/m.steenwijk/miniconda2/lib/python2.7/site-packages/keras/engine/training_utils.py", line 237, in check_array_length_consistency
'and ' + str(list(set_y)[0]) + ' target samples.')
ValueError: Input arrays should have the same number of samples as target arrays. Found 3 input samples and 4 target samples.
Line numbers may be a little different because I did some modifications.
I suggest the max number of samples should be dividable by the batch size as a fix.
from cyclegan-keras.
Sorry, I catched another bug (which is only relevant when supervised learning is used).
In load_data it is better to have os.listdir(trainA_path) (and testA, trainB, testB) sorted, because the listdir output is not neccessarily sorted. (output of listdir is dependent on how it is stored in de filesystem).
Solution is to use
trainA_image_names = sorted(os.listdir(trainA_path))
from cyclegan-keras.
Hi @MrtnStnwk,
Seemed to have missed your last post. Great that you are commenting the errors, thank you.
I remember working on the error with number of samples needing to be dividable by the batch size but evidentially it is still a problem in this model. I will add a comment on this for now.
Regarding the sorting error you have found you can create a pull request if you want to, otherwise I will update it myself.
from cyclegan-keras.
Related Issues (20)
- Use numpy array as input HOT 4
- Error when batch size > 1 HOT 2
- Error in the adversarial least-squares loss for the discriminator HOT 4
- Save cycle_loss to training_history? HOT 2
- Histogram HOT 4
- Error with Dimention HOT 5
- Is It able to convert into coreML tools? HOT 2
- Saving weights as .hdf5 file.
- How do I run the model.py file using GPU? HOT 1
- Issue with generation of images HOT 1
- Weight initialized as? HOT 1
- Recreating night2day results HOT 6
- error in line 652
- Generator bug?
- Valid value for G_loss
- what's the purpose of using Network in line 115 to 122?
- keras and tensorflow version?
- tensorflow.python.framework.errors_impl.FailedPreconditionError
- where is CycleGAN.py?
- How can i solve the proble 'UnboundLocalError: local variable 'real_images_A' referenced before assignment'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cyclegan-keras.