Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: a bytes-like object is required, not 'dict' #7

Open
surabhshahmobiliya opened this issue Jan 22, 2019 · 4 comments
Open

Comments

@surabhshahmobiliya
Copy link

I am trying to implement ../keras-text-classification/20_news_group_classification.py

However its showing me the error as shown in the image
pqr

Libraries installed

keras==2.2.4
tensorflow==1.0.0
Python 3.6.6

@hussamsayeed
Copy link

Did you resolved this?

@DiegoAnas
Copy link

I had the same error, but I fixed it by converting the list, in your case train_posts, which was a list of bytes into a list of str. You can do that easily saving them all into another list with .decode('utf-8')

@DullPointerException
Copy link

DiegoAnas' solution worked for me.

Had this same issue when evecuting :
tokenizer.fit_on_texts(training_sentences)

Changed it to :
tokenizer.fit_on_texts([x.decode('utf-8') for x in training_sentences] )

It worked fine now

@wikazp
Copy link

wikazp commented Nov 22, 2021

image
Having the same error. Can anyone help me out on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants