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

AttributeError: 'list' object has no attribute 'gen' #17

Closed
flrgsr opened this issue Nov 8, 2017 · 2 comments
Closed

AttributeError: 'list' object has no attribute 'gen' #17

flrgsr opened this issue Nov 8, 2017 · 2 comments

Comments

@flrgsr
Copy link

flrgsr commented Nov 8, 2017

Hi,

I am trying to run the "Cat to Tiger Translation" test with python cocogan_translate_one_image.py --config ../exps/unit/cat2tiger.yaml --a2b 1 --weights ../outputs/unit/cat2tiger/cat2tiger_gen_00500000.pkl --image_name ../images/cat001.jpg --output_image_name ../results/cat2tiger_cat001.jpg and get the following error:

AttributeError: 'list' object has no attribute 'gen'

By inspecting the source code in cocogan_translate_one_image.py:42 (https://github.com/mingyuliutw/UNIT/blob/master/src/cocogan_translate_one_image.py#L42) I find that trainer is here indeed first defined as as list. The exec command in the next line seems to turn this into a dict (?) so it seems that this is the source of the error.

What to do? (I am using Python3)
Thx

@mingyuliutw
Copy link
Owner

The code was tested in Python2. I actually don't know what could be the issues in Python3.
But I think you might be able to fix the error by commenting out
trainer = []
in L42 of cocogan_translate_one_image.py

@mingyuliutw
Copy link
Owner

Have you resulted the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants