alex-sage / logo-gen

Accompanying code for the paper "Logo Synthesis and Manipulation with Clustered Generative Adversarial Networks"
MIT License
86 stars 25 forks source link

missing file #1

Open fen328199260 opened 5 years ago

fen328199260 commented 5 years ago

[warren@cernet dcgan]$ python main.py Traceback (most recent call last): File "main.py", line 4, in from model import DCGAN File "/home/warren/logo-gen-master/dcgan/model.py", line 11, in from utils import * File "/home/warren/logo-gen-master/dcgan/utils.py", line 22, in import file_handling as fh ImportError: No module named file_handling

There are some files missing from your project. I find them are listed in the .gitignore, could you please upload those files? thanks.

alex-sage commented 5 years ago

Hi, thanks for pointing this out to me. "file_handling" is actually an old module which is not used in the current code. You should be able to simply comment out line 22 in utils.py to get rid of the error. Sorry for this oversight, I'll correct the code in the repo right away. If you run into any other difficulties, please let me know.

alex-sage commented 5 years ago

I just noticed that the metrics module is in fact still used, and uploaded the respective file. Again, if you notice any more problems, please let me know.

fen328199260 commented 5 years ago

Thanks for your code. I have found some new problems:

  1. the parameter sigma does not seem to be used in the code and the type may be float.
  2. the parameter sample_dir is not available in the WGAN initialization list.
  3. two parameters are required here, but the function only returns one parameter.
  4. sample_images needs to be transposed ( sample_images = sample_images.transpose((0,2,3,1)) ) before inputting the generator.

By the way, which version of tensorflow are you using to run this code?

alex-sage commented 5 years ago

Hi, sorry for not addressing your issues... I didn't have a lot of time on my hands so I seem to have completely forgotten about it.

For the record (even though I'd assume you don't need it any more):

  1. This parameter is only used when using truncated gaussian sampling. It is read here. You're correct however that it should be of type float (I never really used truncated gaussian so I never noticed I guess).
  2. This is strange indeed. Seems to be some haphazard refactoring... I'll remove it from the constructor call.
  3. The function you linked to returns make_generator() defined right above it, which in turn returns get_epoch() which yields the tuple (images, labels). So no issue here.
  4. Yes you're right, they have to for my datasets. My wgan implementation uses NCHW, so there they're in the right format, didn't think about that when simply linking to the data generator. Thanks for pointing this out.

DCGAN runs with the same tensorflow version as the original implementation (Tensorflow 0.12.1) however it was tested and should be compatible with at least up to TF 1.3 if I recall correctly.

fen328199260 commented 5 years ago

Thanks for your reply, and also apologize for that I did not describe the third point clearly. The function load returns a function address, but when you try to call the function load , you not only want to get the address but also the number of images, so I guess that output parameters of the function load should be return make_generator(hdf5_file, n_images, batch_size, res=resolution, label_name=label_name), n_images.