lifangda01 / AdaptiveSupervisedPatchNCE

Other
22 stars 1 forks source link

AttributeError: 'NoneType' object has no attribute 'weight_norm' #3

Closed Ahashluxy closed 1 year ago

Ahashluxy commented 1 year ago

Hello, researchers, when I use the model here for custom data set training, this kind of error occurred. I would appreciate your help.

dataset [AlignedDataset] was created Traceback (most recent call last): File "/data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/train.py", line 14, in model = create_model(opt) # create a model given opt.model and other options File "/data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/models/init.py", line 65, in create_model instance = model(opt) File "/data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/models/cpt_model.py", line 82, in init self.netD = networks.define_D(opt.output_nc, opt.ndf, opt.netD, opt.n_layers_D, opt.normD, opt.init_type, opt.init_gain, opt.no_antialias, self.gpu_ids, opt) File "/data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/models/networks.py", line 317, in define_D net = NLayerDiscriminator(input_nc, ndf, n_layers=3, norm_layer=norm_layer, no_antialias=no_antialias,) File "/data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/models/networks.py", line 1308, in init if opt.weight_norm == 'spectral': AttributeError: 'NoneType' object has no attribute 'weight_norm'

Ahashluxy commented 1 year ago

here are options ----------------- Options --------------- CUT_mode: CUT
batch_size: 1
beta1: 0.5
beta2: 0.999
checkpoints_dir: ./checkpoints
continue_train: False
crop_size: 256
dataroot: /data/yaoxiaoxu/AdaptiveSupervisedPatchNCE-master/datasets/he_cd4/TrainValAB/ dataset_mode: aligned
direction: AtoB
display_env: main
display_freq: 400
display_id: None
display_ncols: 4
display_port: 8097
display_server: http://localhost
display_winsize: 256
easy_label: experiment_name
epoch: latest
epoch_count: 1
evaluation_freq: 5000
flip_equivariance: False
gan_mode: vanilla
gpu_ids: 0
init_gain: 0.02
init_type: xavier
input_nc: 3
isTrain: True [default: None] lambda_GAN: 1.0
lambda_NCE: 1.0
load_size: 286
lr: 0.0002
lr_decay_iters: 50
lr_policy: linear
max_dataset_size: inf
model: cut
n_epochs: 200
n_epochs_decay: 200
n_layers_D: 3
name: experiment_name
nce_T: 0.07
nce_idt: True
nce_includes_all_negatives_from_minibatch: False
nce_layers: 0,4,8,12,16
ndf: 64
netD: basic
netF: mlp_sample
netF_nc: 256
netG: resnet_9blocks
ngf: 64
no_antialias: False
no_antialias_up: False
no_dropout: True
no_flip: False
no_html: False
normD: instance
normG: instance
num_patches: 256
num_threads: 4
output_nc: 3
phase: train
pool_size: 0
preprocess: resize_and_crop
pretrained_name: None
print_freq: 100
random_scale_max: 3.0
save_by_iter: False
save_epoch_freq: 5
save_latest_freq: 5000
serial_batches: False
stylegan2_G_num_downsampling: 1
suffix:
update_html_freq: 1000
verbose: False
weight_norm: spectral

lifangda01 commented 1 year ago

Should be fixed in 118405c.