akanimax / t2f Goto Github PK
View Code? Open in Web Editor NEWT2F: text to face generation using Deep Learning
License: MIT License
T2F: text to face generation using Deep Learning
License: MIT License
How would we go if we wanted to implement an evaluation metric for generator part?
I have tried to load a pre-trained discriminator addition to the discriminator that trained during training. And tested the generator with pre-trained discriminator at the end of each epoch. But I am not sure if this is a good way to measure the performance of generator.
Are there any feasible methods? I have done a little literature survey to see what are the methods of evaluating gans, but they are usually for datasets with certain classes. Since we do not have classes in T2F (or do we?) I have hard time implementing methods such as Inception Score , Frechet Inception Distance etc.
One method that I found is CrossLID (https://arxiv.org/abs/1905.00643). Which also has implementation on GitHub. However I did not try to implement it yet as I am unsure if it is suitable for this dataset-model.
I have trained the model, but now I need to test it.
I took the demo.py as inspiration for the new demo, and am trying to give my custom caption as input. However I do not know how to do so.
# load the model for the demo
gen = th.nn.DataParallel(pg.Generator(depth=9))
gen.load_state_dict(th.load("GAN_GEN_SHADOW_8.pth", map_location=str(device)))
How do I change the above code for making my trained model work?
Hi,
Thank you so much for your work! I just obtained the v2 of the dataset which has 10 times the images(4000 now) and wanted to get started on this task. Would it still be a good idea to use this repo or is T2F v2 right around the corner? Or can you suggest the changes I can do to bring this implementation as close to v2 as possible?
Thanks
Dataset=> http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
The data set is very large with respect to the LFW data set which only has 400 images in it.
I wonder if it can be used for training the model.
Given that T2F 2.0 is around the corner, the model might perform better with a larger image dataset.
Since I was having issues with PyTorch 0.4.0, mainly with importing interpolate, I decided to install PyTorch 1.0.0. However when I run the train_network.py file, I get this error.
How do I fix this?
When I run train_network.py,
I get the error:
Traceback (most recent call last):
File "train_network.py", line 428, in
main(parse_arguments())
File "train_network.py", line 381, in main
device=device
TypeError: init() got an unexpected keyword argument 'embedding_size'
Does anyone know how to solve this?
hi @akanimax,I downloaded lfw dataset but failed to find clean.json. It seemed that you have cleaned the lfw dataset,can you tell me how, or provide clean.json file? thanks very much.
Traceback (most recent call last):
File "train_network.py", line 427, in
main(parse_arguments())
File "train_network.py", line 380, in main
device=device
File "/home/mukesh/env1/local/lib/python2.7/site-packages/pro_gan_pytorch/PRO_GAN.py", line 523, in init
self.loss = self.__setup_loss(loss)
File "/home/mukesh/env1/local/lib/python2.7/site-packages/pro_gan_pytorch/PRO_GAN.py", line 552, in __setup_loss
loss = losses.CondWGAN_GP(self.device, self.dis, self.drift, use_gp=True)
File "/home/mukesh/env1/local/lib/python2.7/site-packages/pro_gan_pytorch/Losses.py", line 136, in init
super().init(device, dis)
TypeError: super() takes at least 1 argument (0 given)
following install torch 0.4.0 as required, I encountered module 'torch.nn.functional' has no attribute 'interpolate'
, while is introduced in 0.4.1.
Please include the pytorch model in the repo, so that it is easy to obtain inference using demo.py or any such program.
I replace ProGAN with MSG-StyleGAN as you mentioned before. I used 400 images from RIVAL group and mode collapse always happen. Any idea for this?
Thanks.
The closed nature of dataset used creates troubles for random contributors including me wishing to debug and improve.
If there is an open alternative it should be linked, if not - [collaboratively] created.
Traceback (most recent call last):
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 427, in
main(parse_arguments())
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 380, in main
device=device
TypeError: init() got an unexpected keyword argument 'embedding_size'
Could you please tell me how to deal with this ERROR?
When I run train_network.py,
I get the error:
Traceback (most recent call last):
File "train_network.py", line 428, in <module>
main(parse_arguments())
File "train_network.py", line 381, in main
device=device
TypeError: __init__() got an unexpected keyword argument 'embedding_size'
Does anyone know how to solve this?
Dear watchers,
I have created a slack group for GAN and Deep RL enthusiasts. I hope we could discuss about problems faced while running code or training a GAN in general or even new potential project ideas. My hope is that if I am not available, then perhaps someone who has faced the same problem in the group could the ones in need. Proactive participation in the group will really benefit us all. I hope this group helps.
link to the group -> https://join.slack.com/t/amlrldl/shared_invite/enQtNDcyMTIxODg3NjIzLTA3MTlmMDg0YmExYjY5OTgyZTg4MTg5ZGE1YzRlYjljZmM4MzI0MTg1OTcxOTc5NDQ4ZTcwMGVkZjBjZmU5ZWM
Best regards,
Animesh
p.s. This issue will be closed in a week
I am getting this error and don't know how to solve it, can you help please?
Starting the training process ...
Traceback (most recent call last):
File "train_network.py", line 426, in
main(parse_arguments())
File "train_network.py", line 420, in main
use_matching_aware_dis=config.use_matching_aware_discriminator
File "train_network.py", line 138, in train_networks
fixed_embeddings = encoder(fixed_captions)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\Download\T2F-master\T2F-master\implementation\networks\TextEncoder.py", line 42, in forward
output, (_, _) = self.network(x)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\sparse.py", line 117, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\functional.py", line 1506, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index'
For numpy we need python version 2.7 and for tensorflow we need 3.5., 3.6., 3.7.* . this makes the python version to be installed in conflict. what to be done in this senerio?
I installed pro_gan_pytorch from your other github repo and ran train_network.py. This is the error I got.
Traceback (most recent call last): File "train_network.py", line 427, in <module> main(parse_arguments()) File "train_network.py", line 307, in main from pro_gan_pytorch.PRO_GAN import ConditionalProGAN ModuleNotFoundError: No module named 'pro_gan_pytorch'
I am facing this error.Please help me to train the network.
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'
@akanimax @AhmedHani I trained the model till 6th depths with epoch(640,320,160,80,40,20) and batch size of 16 in each depth but the output in final pth file wasn't up to the mark. Plus it generates 16 images of a single description. Can you help it out like what exactly are those 16 images and why not a single image for a single description. The image generated isn't good as well. What can I do to improve that ? Can you provide the trained model of augmentation,encoder,gen and dis if image generated is good like you have provided for celeb using msg.
I tried for various depths and resolution but the output isn't clear.
Description:
he is an old man with a wrinkled face , gray hair and no beard he has dark eyes and seems happy about something
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.