Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ml): add lambda #661

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

feat(ml): add lambda #661

wants to merge 7 commits into from

Conversation

wr0124
Copy link
Collaborator

@wr0124 wr0124 commented Jun 19, 2024

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 \

@@ -24,6 +24,8 @@ def __init__(self, opt, rank):
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
Contributor

Choose a reason for hiding this comment

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

lambda1 and lambda2 ?

util/parser.py Outdated
@@ -31,7 +31,7 @@ def get_opt(main_opt, remaining_args):
)

# Save the config file when --save_config is passed
is_config_saved = False
is_config_saved = True # False
Copy link
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
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
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
Copy link
Collaborator Author

wr0124 commented Jun 26, 2024

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