Coder Social home page Coder Social logo

Comments (5)

dashayushman avatar dashayushman commented on August 22, 2024 1

@GaryLMS you are welcome. Closing this issue and good luck (y)

from tac-gan.

dashayushman avatar dashayushman commented on August 22, 2024

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.

GaryLMS avatar GaryLMS commented on August 22, 2024

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.

dashayushman avatar dashayushman commented on August 22, 2024

@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.

GaryLMS avatar GaryLMS commented on August 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.