fengyang0317 / unsupervised_captioning

Code for Unsupervised Image Captioning
MIT License
215 stars 51 forks source link

preprocessing/extract_descriptions.py #28

Closed BetterZH closed 3 years ago

BetterZH commented 4 years ago

c = normalize('NFKD', j['description']).encode('ascii', 'ignore') c = c.split('\n') TypeError: a bytes-like object is required, not 'str'

hi! I can't generate the same sentence.pkl as you. In your sentence.pkl, (lp1 (lp2 S '<S>' p3 aS'beautiful' p4 aS'alley' ..... I don't kown what's the mean about" p1","p2". I need your help.Thanks

BetterZH commented 4 years ago

c = normalize('NFKD', j['description']).encode('ascii', 'ignore') c = c.split('\n') TypeError: a bytes-like object is required, not 'str'

hi! I can't generate the same sentence.pkl as you. In your sentence.pkl, (lp1 (lp2 S '<S>' p3 aS'beautiful' p4 aS'alley' ..... I don't kown what's the mean about" p1","p2". I need your help.Thanks

I solved this problem. This is the reason for the python version. py2 is ok