JDAI-CV / image-captioning

Implementation of 'X-Linear Attention Networks for Image Captioning' [CVPR 2020]
268 stars 52 forks source link

_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?) #6

Closed Tushar-Faroque closed 4 years ago

Tushar-Faroque commented 4 years ago

Hello, Thank you for your work and the code. When I run this python3 tools/create_feats.py --infeats bottom_up_tsv --outfolder ./mscoco/feature/up_down_10_100, I am getting this error _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?) I am running on python 3.7 Please help me out.

Panda-Peter commented 4 years ago

Thanks for pointing this out. We have changed the command as "python2 tools/create_feats.py --infeats bottom_up_tsv --outfolder ./mscoco/feature/up_down_10_100" (i.e., python3 -> python2). Everything should be fine now.

Tushar-Faroque commented 4 years ago

I tried with "python2 tools/create_feats.py --infeats bottom_up_tsv --outfolder ./mscoco/feature/up_down_10_100" Now, it's showing "ImportError: No module named numpy", but I have installed numpy=1.16.4 in my environment. Also, tried with other python versions with different numpy versions

Panda-Peter commented 4 years ago

Hi, maybe you can refer the processing of tsv in https://github.com/peteanderson80/bottom-up-attention/blob/master/tools/read_tsv.py.

Tushar-Faroque commented 4 years ago

Okay, Thanks a lot. I will do that.