Skip to content

feat(ml): add lambda#661

Open
wr0124 wants to merge 7 commits into
jolibrain:masterfrom
wr0124:cm_gan_lambda
Open

feat(ml): add lambda#661
wr0124 wants to merge 7 commits into
jolibrain:masterfrom
wr0124:cm_gan_lambda

Conversation

@wr0124

@wr0124 wr0124 commented Jun 19, 2024

Copy link
Copy Markdown
Collaborator

add function lambda into cm_gan_model

  • inference
  • unit tests
  • documentation

The training works with the following command line

python3 train.py
--dataroot /data1/juliew/dataset/noglasses2glasses_ffhq
--checkpoints_dir /data1/juliew/checkpoints
--name noglasses2glasses_cm_gan
--config_json examples/example_cm_gan_noglasses2glasses.json
--gpu_ids 1
--D_netDs basic projected_d vision_aided\

The inference works with the following command line

mkdir noglasses2glasses_inference_output
cd scripts/
python3 gen_single_image_diffusion.py
--model_in_file /data1/juliew/checkpoints/noglasses2glasses_cm_gan/latest_net_G_A.pth
--img_in /data1/juliew/dataset/noglasses2glasses_ffhq/trainA/img/00002.jpg
--mask_in /data1/juliew/dataset/noglasses2glasses_ffhq/trainA/bbox/00002.jpg
--dir_out /data1/juliew/cm_gan_lambda/joliGEN/noglasses2glasses_inference_output
--img_width 128
--img_height 128 \

Comment thread models/cm_gan_model.py Outdated
visual_names_B = ["real_B"]
self.visual_names.append(visual_names_A)
self.visual_names.append(visual_names_B)
self.variable1 = 0.6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lambda1 and lambda2 ?

Comment thread util/parser.py Outdated

# Save the config file when --save_config is passed
is_config_saved = False
is_config_saved = True # False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't change this ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i don not set this into True, I can not have train_config.json file, then, can not do the inference. I'll see if there has other ways

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has no config_save option description in the joliGEN.

@wr0124

wr0124 commented Jun 26, 2024

Copy link
Copy Markdown
Collaborator Author

I think I do not fully get your idea to "add lambda_gan to self and then to visual_names for it to be plotted." I thought lambda_gan should appear in a separate Visdom window? P.S.: This modification does not display the lambda, and I do not get why use detach here. since in the loss.py , the fake image tensor has already get detached for calculation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants