elvisyjlin / AttGAN-PyTorch

AttGAN PyTorch Arbitrary Facial Attribute Editing: Only Change What You Want
MIT License
248 stars 61 forks source link

AttributeError: 'Namespace' object has no attribute 'data' #9

Closed maryamashoori closed 5 years ago

maryamashoori commented 5 years ago

Hi Yu-Jing, Any thoughts on how I can get past this error? I commented that line, but then it complained for a similar argument problem on /attgan.py", line 130, in __init__ self.lambda_1 = args.lambda_1

AttGAN-PyTorch]$ CUDA_VISIBLE_DEVICES=0 python3 test_multi.py --experiment_name 128_shortcut1_inject0_none --test_atts Pale_Skin Male --test_ints 0.5 0.5 --gpu Namespace(experiment_name='128_shortcut1_inject0_none', gpu=True, load_epoch='latest', num_test=None, test_atts=['Pale_Skin', 'Male'], test_ints=[0.5, 0.5]) Traceback (most recent call last): File "test_multi.py", line 66, in <module> if args.data == 'CelebA': AttributeError: 'Namespace' object has no attribute 'data'

elvisyjlin commented 5 years ago

Hi @maryamashoori , it's my fault. The two setting.txt in experiment 128_shortcut1_inject0_none and 128_shortcut1_inject1_none miss the config of data. They should both have "data": "CelenA",. I've uploaded new version. Or you can add them in the file you downloaded to fix the error. Thank you for telling me this.

maryamashoori commented 5 years ago

@elvisyjlin Thank you! That solved the 'data' attribute problem but still gives me this namespace error:

AttGAN-PyTorch]$ CUDA_VISIBLE_DEVICES=0 python3 test_multi.py --experiment_name 128_shortcut1_inject0_none --test_atts Pale_Skin Male --test_ints 0.5 0.5 --gpu Namespace(experiment_name='128_shortcut1_inject0_none', gpu=True, load_epoch='latest', num_test=None, test_atts=['Pale_Skin', 'Male'], test_ints=[0.5, 0.5]) Testing images: 19962 Traceback (most recent call last): File "test_multi.py", line 82, in <module> attgan = AttGAN(args) File "/u/maryam/AttGAN-PyTorch/attgan.py", line 130, in __init__ self.lambda_1 = args.lambda_1 AttributeError: 'Namespace' object has no attribute 'lambda_1'

elvisyjlin commented 5 years ago

These days I'm updating the training code and I made the parameters configurable. But I forgot to update the pre-trained models. I've updated them. Please download it again. Let me know if you have any questions.