SummitKwan / transparent_latent_gan

Use supervised learning to illuminate the latent space of GAN for controlled generation and edit
MIT License
1.97k stars 363 forks source link

NCHW issue with Conv2D #18

Closed prusnak closed 5 years ago

prusnak commented 5 years ago

My system does not have a Nvidia GPU, so CPU is used. This results in the following error:

tensorflow.python.framework.errors_impl.UnimplementedError: Generic conv implementation only supports NHWC tensor format for now.
     [[Node: G_paper_1/Run/G_paper_1/4x4/Conv/Conv2D = Conv2D[T=DT_FLOAT, data_format="NCHW", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](G_paper_1/Run/G_paper_1/4x4/Dense/PixelNorm/mul, G_paper_1/Run/G_paper_1/4x4/Conv/mul)]]

Further investigation shows that for CPU only NHWC tensor format is supported, not NCHW. It seems there is a solution though: https://stackoverflow.com/questions/37689423/convert-between-nhwc-and-nchw-in-tensorflow

SummitKwan commented 5 years ago

Hi prusnak,

Thank you for your feedback! Yes you are right, the issues on CPU is the NHWC tensor format. I hope I can get time to work on this issue soon.

prusnak commented 5 years ago

Has this been fixed or is this a wontfix?

SummitKwan commented 5 years ago

Hi @prusnak, sorry for not communicating with you before closing this issue. This will not be the immediate priority for the project so far. However, I will work on implementing algorithms to map user-uploaded photos to the latent space, I will see if I can get this NHWC issue fixed along that line of work. Thank you again for your suggestions.

prusnak commented 5 years ago

Fair enough. I am not even sure it makes sense trying to fix this, I just wanted to know why this was closed. Thank you!