targetloader_iter = enumerate(target_loader) upsample_1024 = nn.Upsample(size=[1024, 2048], mode='bilinear') model_dict = {} private_code_size = 8 shared_code_channels = 2048 enc_shared = SharedEncoder().cuda() #dclf1 = DomainClassifier().cuda() #dclf2 = DomainClassifier().cuda() #enc_s = PrivateEncoder(64, private_code_size).cuda() enc_t = PrivateEncoder(64, private_code_size).cuda() #dec_s = PrivateDecoder(shared_code_channels, private_code_size).cuda() dec_t = PrivateDecoder(shared_code_channels, private_code_size).cuda() #dis_s2t = Discriminator().cuda() #dis_t2s = Discriminator().cuda() model_dict['enc_shared'] = enc_shared model_dict['enc_t'] = enc_t #model_dict['dec_s'] = dec_s model_dict['dec_t'] = dec_t load_models(model_dict, args.weight_dir) enc_shared.eval() enc_t.eval() dec_t.eval()
sourceloader_iter = enumerate(source_loader) targetloader_iter = enumerate(target_loader) # Setup Metrics cty_running_metrics = runningScore(num_classes) model_dict = {} # Setup Model print('building models ...') enc_shared = SharedEncoder().cuda() dclf1 = DomainClassifier().cuda() dclf2 = DomainClassifier().cuda() enc_s = PrivateEncoder(64, private_code_size).cuda() enc_t = PrivateEncoder(64, private_code_size).cuda() dec_s = PrivateDecoder(shared_code_channels, private_code_size).cuda() dec_t = dec_s dis_s2t = Discriminator().cuda() dis_t2s = Discriminator().cuda() model_dict['enc_shared'] = enc_shared model_dict['dclf1'] = dclf1 model_dict['dclf2'] = dclf2 model_dict['enc_s'] = enc_s model_dict['enc_t'] = enc_t model_dict['dec_s'] = dec_s model_dict['dec_t'] = dec_t model_dict['dis_s2t'] = dis_s2t model_dict['dis_t2s'] = dis_t2s enc_shared_opt = optim.SGD(enc_shared.optim_parameters(learning_rate_seg),
# Setup Metrics cty_running_metrics = runningScore(num_classes) model_dict = {} # Setup Model print('building models ...') enc_shared = SharedEncoder().cuda() dclf1 = DomainClassifier().cuda() dclf2 = DomainClassifier().cuda() dclf3 = DomainClassifier().cuda() enc_sty_s = PrivateEncoder(64, private_code_size).cuda() enc_sty_t1 = PrivateEncoder(64, private_code_size).cuda() dec_sty_s = PrivateDecoder(shared_code_channels, private_code_size).cuda() dec_sty_t1 = dec_sty_s enc_fog_t1 = PrivateEncoder(64, private_code_size).cuda() enc_fog_t2 = PrivateEncoder(64, private_code_size).cuda() dec_fog_t1 = PrivateDecoder(shared_code_channels, private_code_size).cuda() dec_fog_t2 = dec_fog_t1 enc_dual_s = PrivateEncoder(64, private_code_size).cuda() enc_dual_t2 = PrivateEncoder(64, private_code_size).cuda() dec_dual_s = PrivateDecoder(shared_code_channels, private_code_size).cuda() dec_dual_t2 = dec_dual_s dis_s2t = Discriminator().cuda() dis_t2s = Discriminator().cuda()