atulkum / pointer_summarizer

pytorch implementation of "Get To The Point: Summarization with Pointer-Generator Networks"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

susht3 opened this issue · comments

commented

i use py3 + pytorch0.4, i got this error of batcher:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/work/anaconda3/envs/susht/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/work/anaconda3/envs/susht/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/work/sushuting/pointer_summarizer/data_util/batcher.py", line 223, in fill_example_queue
abstract_sentences = [sent.strip() for sent in data.abstract2sents(abstract)] # Use the and tags in abstract to get a list of sentences.
File "/home/work/sushuting/pointer_summarizer/data_util/data.py", line 151, in abstract2sents
start_p = abstract.index(SENTENCE_START, cur)
TypeError: a bytes-like object is required, not 'str'

I have tested it on python 2.7 + pytorch 0.3

I would welcome the PR if you can port it to python 3.0