Open AtmaHou opened 7 years ago
I encountered the same question as you did.
I followed your guidance but I still face the question below.
Traceback (most recent call last):
File "run.py", line 213, in
Could you please show me the way to solve this?
Hi, My fix works only on windows, problem still remains for linux. Maybe, you are running on linux?
I encounter the problem too, and the solution doesn't work for me~ I don't understand why reading the model_path is related to 'convert string to float'?
I am facing the same problem
change to : model_params = pickle.load(open(model_path, 'rb'), encoding='iso-8859-1')
encoding='iso-8859-1'
On what platform are you running this code。
I encountered the same question as you did. I followed your guidance but I still face the question below. Traceback (most recent call last): File "run.py", line 213, in nlg_model.load_nlg_model(nlg_model_path) File "/home/jason/Jason/DialogueSystem/TC-Bot_U/src/deep_dialog/nlg/nlg.py", line 138, in load_nlg_model model_params = pickle.load(open(model_path, 'r')) ValueError: could not convert string to float
Could you please show me the way to solve this?
The idea of loading pickle file is to load a binary coded file. since the models they have prepared are in string format you need to recreate the model files by loading the dictionaries out of the models by pickle.load and then dump it into another pickle file. or you can use different types of encoding on pickle.load
dos2unix your_pickle_file.pk
Replacing end-of-line from CR+LF (\r\n) into LF (\n) works for me
When I try to run the code with Rule Agent's prams, I got this: ValueError: could not convert string to float: My solution is changing the file-pointer loading style from "rb" to "r", and it works for me. Two place need to fix:
line 50 in nlu.py
line138 in nlg.py
I know someone may not encounter the error, and just could enjoy the code perfectly.