InnerPeace-Wu / densecap-tensorflow

Re-implement CVPR2017 paper: "dense captioning with joint inference and visual context" and minor changes in Tensorflow. (mAP 8.296 after 500k iters of training)
MIT License
61 stars 28 forks source link

TypeError: a bytes-like object is required, not 'str' #40

Closed batooooo closed 4 years ago

batooooo commented 4 years ago

hello when i try to this $ cd $ROOT/lib $ python preprocess.py --version [version] --path [raw_data_path] \ --output_dir [dir] --max_words [max_len]$ cd $ROOT/lib ,

i have type error..

split image number: 77398 for split name: train start loading json files... 10.529908 seconds for loading train: 0%| | 0/108077 [00:00<?, ?it/s] Traceback (most recent call last): File "preprocess.py", line 226, in process_vg() File "preprocess.py", line 222, in process_vg vocab = process_dataset(split_name, vocab=vocab) File "preprocess.py", line 196, in process_dataset split_ids=split_image_ids, vocab=vocab) File "preprocess.py", line 117, in init obj['phrase_tokens'] = phrase.translate(None, string.punctuation).split() TypeError: a bytes-like object is required, not 'str'

how to fix it?

Anth0nyWu commented 4 years ago

So how did you solve it please.