Mukosame/Zooming-Slow-Mo-CVPR-2020

list object has no attribute 'add'

rogerchenrc opened this issue · 2 comments

Hello, @Mukosame,
While I am creating lmdb files and I got the following error " list object has no attribute 'add' ", and I am interested in why you write add in here because it is not common to see list with add method. And is this error due to different version of python? (I used python 3.8) Is there any recommend way that I can resolve this issue? Should I just define key_set=set()? Thank you!

File "create_lmdb_mp.py", line 120, in vimeo7
key_set.add('{}_{}'.format(a, b))
AttributeError: 'list' object has no attribute 'add'

and your original code from create_lmdb_mp.py is shown below

key_set = [ ]
for key in keys:
    a, b, _ = key.split('_')
    key_set.add('{}_{}'.format(a, b))
meta_info['keys'] = key_set

I replaced .add with .append and it works correctly.

Hi @rogerchenrc , thanks for discovering this issue! You can either define it as set, or modify the .add into .append like @kosmar2011 recommends. Feel free to create a pull request for this issue, thanks!