Comments (5)
@GaryLMS you are welcome. Closing this issue and good luck (y)
from tac-gan.
Hi @GaryLMS ,
could you provide the hyper-params that you are using while training and generating images? Because I used a fixed set of parameters for training and generating the images and it works fine.
PS: I have fixed some minor bugs though. Note that I have changed the model.py script. If you are using the old code then just checkout everything except for model.py
from tac-gan.
Hello @dashayushman
Thanks for your reply!!!
I train the model again yesterday with step 1.4 command
$python train.py --t_dim=100 --image_size=128 --data_set=flowers --model_name=TAC_GAN --train=True --resume_model=True --z_dim=100 --n_classes=102 --epochs=400 --save_every=20 --caption_vector_length=4800 --batch_size=128
I just update the model.py you just modified, and I first encode the text into vectors by
$python encode_text.py --caption_file=Data/text.txt --data_dir=Data
and then use the command you just update
$python generate_images.py --data_set=flowers --checkpoints_dir=Data/training/TAC_GAN/checkpoints --images_per_caption=30 --data_dir=Data
now it comes
2017-07-28 21:18:56.734720: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [512] rhs shape= [100]
[[Node: save/Assign_13 = Assign[T=DT_FLOAT, _class=["loc:@d_embedding/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](d_embedding/bias, save/RestoreV2_13/_19)]]
2017-07-28 21:18:56.734810: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [512] rhs shape= [100]
[[Node: save/Assign_13 = Assign[T=DT_FLOAT, _class=["loc:@d_embedding/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](d_embedding/bias, save/RestoreV2_13/_19)]]
2017-07-28 21:18:56.734814: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [512] rhs shape= [100]
[[Node: save/Assign_13 = Assign[T=DT_FLOAT, _class=["loc:@d_embedding/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](d_embedding/bias, save/RestoreV2_13/_19)]]
2017-07-28 21:18:56.736200: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [512] rhs shape= [100]
....
Thank you!
P.S. I find you also update train.py, so should I re-train model to get correct result?
Oh, I think the problem is the command I use for training is
$python train.py --t_dim=100 --image_size=128 --data_set=flowers --model_name=TAC_GAN --train=True --resume_model=True --z_dim=100 --n_classes=102 --epochs=400 --save_every=20 --caption_vector_length=4800 --batch_size=128
set t_dim = 100, but the default t_dim in generate_images.py is 512(and you just modified to 256), so the size is mismatch, so I add the argument
$python generate_images.py --data_set=flowers --checkpoints_dir=Data/training/TAC_GAN/checkpoints --images_per_caption=30 --data_dir=Data --t_dim=100
now I can generate images successfully! Thank you.
from tac-gan.
@GaryLMS please retrain the model for some iterations and then use the following command for generating the images
$python generate_images.py --t_dim=100 --data_set=flowers --checkpoints_dir=Data/training/TAC_GAN/checkpoints --images_per_caption=30 --data_dir=Data
you can notice that I have added t_dim=100
. I believe this is what is causing the dimension mismatch. As mentioned in the README file, whenever you change your hyperparameters, please use the same in all other scripts which need them.
from tac-gan.
@dashayushman
Thank you! I also find the mismatch in t_dim, I have updated my comment, the problem has been solved!!!
Thanks for your reply!
from tac-gan.
Related Issues (14)
- Evaluation with FID HOT 2
- Section 2: generating dataset HOT 2
- MSSSIM error
- scikit-image is not working with this utils
- how to train on gpu HOT 1
- generating images error
- Images generated from text were less than ideal HOT 3
- Generating images using MS_COCO dataset
- Have you tried generating images on birds dataset? HOT 1
- Assign requires shapes of both tensors to match, lhs shape=256 rhs shape=100 HOT 1
- How to use this model for data without class labels? HOT 2
- How to use the attention function?
- Generating Images for the text in the dataset
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 tac-gan.