Closed MauryaRitesh closed 6 years ago
Googling the error would get the answer quickly, but because you asked it here I might as well give you the answer.
with open(config_path) as f:
saved_args = cPickle.load(f)
should be
with open(config_path, 'rb') as f:
saved_args = cPickle.load(f)
You should do the same for any other times this error appears. For some explanation, this will make cPickle load the file as a byte object instead of String, as rb
stands for Read Binary.
Sources:
That wasn't a solution I was looking for. Actually, there is not any module named cPickle, instead I tried _Pickle, that worked, but even I had a lot of errors in your code. So, I'm gonna create my own chatbot and soon I'll post a link to that to you. Thanks for your reply.
I used the module pickle
and that worked with what I gave. Anyways, glad to see that you got it working, sorry if I may have sounded rude while giving my response, I was pretty tired.
P.S. this isn't my project ;)
Can load the file as below code? cs = pickle.load(open(it_path))
It gives the pickle TypeError: a bytes-like object is required, not 'str'
Getting this error: Traceback (most recent call last): File "chatbot.py", line 301, in
main()
File "chatbot.py", line 35, in main
sample_main(args)
File "chatbot.py", line 60, in sample_main
saved_args = cPickle.load(f)
TypeError: a bytes-like object is required, not 'str'