- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.9k
Pix2pix #2296
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
Pix2pix #2296
Conversation
        
          
                PaddleCV/gan/.pre-commit-config.yaml
              
                Outdated
          
        
      | @@ -0,0 +1,35 @@ | |||
| repos: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件可以不要
| if args.crop_type == 'Centor': | ||
| img1 = CentorCrop(img1, args.crop_size, args.crop_size) | ||
| img2 = CentorCrop(img2, args.crop_size, args.crop_size) | ||
| elif args.crop_type == 'Random': | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的get_preprocess_param 去掉crop_pos,这里可以直接调用RandomCrop
        
          
                PaddleCV/gan/data_reader.py
              
                Outdated
          
        
      | img2 = (np.array(img2).astype('float32') / 255.0 - 0.5) / 0.5 | ||
| img2 = img2.transpose([2, 0, 1]) | ||
| if return_name: | ||
| #batch_out_1.append( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要去掉注释
        
          
                PaddleCV/gan/data_reader.py
              
                Outdated
          
        
      | batch_out_2.append(img2) | ||
| batch_out_3.append(os.path.basename(files[0])) | ||
| else: | ||
| #batch_out_1.append( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
        
          
                PaddleCV/gan/data_reader.py
              
                Outdated
          
        
      | if len(batch_out_1) == self.batch_size: | ||
| if return_name: | ||
| yield batch_out_1, batch_out_2, batch_out_3 | ||
| #yield batch_out_1 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,下面的注释也去掉
        
          
                PaddleCV/gan/scripts/run_pix2pix.sh
              
                Outdated
          
        
      | #export FLAGS_reader_queue_speed_test_mode=True | ||
| export FLAGS_eager_delete_tensor_gb=0.0 | ||
| export FLAGS_fast_eager_deletion_mode=1 | ||
| export FLAGS_fraction_of_gpu_memory_to_use=0.01 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面这些配置需要删掉
        
          
                PaddleCV/gan/trainer/Pix2pix.py
              
                Outdated
          
        
      | loss_name=dis_trainer.d_loss.name, | ||
| build_strategy=build_strategy) | ||
|  | ||
| #losses = [[], []] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉注释
        
          
                PaddleCV/gan/trainer/Pix2pix.py
              
                Outdated
          
        
      | 0], d_loss_real[0], d_loss_fake[0], batch_time)) | ||
|  | ||
| #losses[0].append(g_A_loss[0]) | ||
| #losses[1].append(d_A_loss[0]) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉上面的注释
        
          
                PaddleCV/gan/util/config.py
              
                Outdated
          
        
      | add_arg('model_net', str, "cgan", "The model used.") | ||
| add_arg('dataset', str, "mnist", "The dataset used.") | ||
| add_arg('model_net', str, "Pix2pix", "The model used.") | ||
| add_arg('dataset', str, "cityscapes", "The dataset used.") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要修改上面的默认值
| add_arg('norm_type', str, "batch_norm", "Which normalization to used") | ||
| add_arg('learning_rate', int, 0.0002, "the initialize learning rate") | ||
| add_arg('learning_rate', float, 0.0002, "the initialize learning rate") | ||
| add_arg('lambda_L1', float, 100.0, "the initialize learning rate") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个可以放在pix2pix特有的参数里?
…2pix Conflicts: PaddleCV/gan/data_reader.py PaddleCV/gan/scripts/run_pix2pix.sh PaddleCV/gan/trainer/Pix2pix.py PaddleCV/gan/util/config.py
…2pix Conflicts: PaddleCV/gan/data_reader.py PaddleCV/gan/scripts/run_pix2pix.sh PaddleCV/gan/trainer/Pix2pix.py PaddleCV/gan/util/config.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
add pix2pix to models