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

python -m demo.qa gives code error #12

Open
wel3kxial opened this issue Apr 22, 2018 · 1 comment
Open

python -m demo.qa gives code error #12

wel3kxial opened this issue Apr 22, 2018 · 1 comment

Comments

@wel3kxial
Copy link

oitai@ours:~/tk/chat/MemN2N-babi-python$ python -m demo.qa
Loading model from file trained_model/memn2n_model.pklz ...
Traceback (most recent call last):
File "/home/ai/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/ai/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/ai/tk/chat/MemN2N-babi-python/demo/qa.py", line 268, in
run_web_demo(args.data_dir, args.model_file)
File "/home/ai/tk/chat/MemN2N-babi-python/demo/qa.py", line 241, in run_web_demo
webapp.init(data_dir, model_file)
File "/home/ai/tk/chat/MemN2N-babi-python/demo/web/webapp.py", line 22, in init
memn2n.load_model()
File "/home/ai/tk/chat/MemN2N-babi-python/demo/qa.py", line 43, in load_model
self.reversed_dict, self.memory, self.model, self.loss, self.general_config = pickle.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 0: ordinal not in range(128)

@vinayakpahalwan7
Copy link

Try changing this line :
self.reversed_dict, self.memory, self.model, self.loss, self.general_config = pickle.load(f)

to this:
self.reversed_dict, self.memory, self.model, self.loss, self.general_config = pickle.load(f, encoding='bytes')

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

2 participants