Evaluation: AttributeError: 'Namespace' object has no attribute 'caption_model'
See original GitHub issueWhen running eval.py on python2.7, I get this error:
File "eval.py", line 99, in <module> model = models.setup(opt) File "/path/to/neuraltalk2.pytorch/models.py", line 16, in setup if opt.caption_model == 'show_tell': AttributeError: 'Namespace' object has no attribute 'caption_model'
It looks like the “caption_model” argument is missing from the Argument Parser in eval.py, causing an error to be thrown when model.py attempts to access it.
I see that there are model settings are in “opts.py”. Are we somehow meant to import these?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
AttributeError: 'Namespace' object has no attribute
You're parsing command line arguments into args , which is a Namespace with attributes set to the parsed arguments.
Read more >attributeerror: 'namespace' object has no attribute
means that the property is not defined in the args parameter. In this case, you expected to define an argument of the name...
Read more >221 fedpkg without arguments: AttributeError: 'Namespace' ...
#221 fedpkg without arguments: AttributeError: 'Namespace' object has no attribute 'command' (PY3). Closed: Fixed 4 years ago Opened 4 years ago by churchyard....
Read more >'Namespace' object has no attribute 'brokeName'
Thread Modes. AttributeError: 'Namespace' object has no attribute 'brokeName' ... Anyway, there is no SantBrk defined in the above code.
Read more >How to run tests: AttributeError: 'Namespace' object has no ...
How to run tests: AttributeError: 'Namespace' object has no attribute 'arguments' ... Done Test parallel calculation with "gpaw -P 4 test".
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ignore = [“id”, “batch_size”, “beam_size”, “start_from”, “language_eval”] for k in vars(infos[‘opt’]).keys(): if k not in ignore: if k in vars(opt): assert vars(opt)[k] == vars(infos[‘opt’])[k], k + ’ option not consistent’ else: vars(opt).update({k: vars(infos[‘opt’])[k]}) # copy over options from model
This part of the code is copying options from the infos.pkl. If you are using the infos.pkl, can you check if caption_model is included in the infos’s option.
I uploaded a corrected one.