Mukosame / Zooming-Slow-Mo-CVPR-2020

Fast and Accurate One-Stage Space-Time Video Super-Resolution (accepted in CVPR 2020)
GNU General Public License v3.0
915 stars 164 forks source link

list object has no attribute 'add' #67

Closed rogerchenrc closed 2 years ago

rogerchenrc commented 2 years ago

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 keyset.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
kosmar2011 commented 2 years ago

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

Mukosame commented 2 years ago

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!