Open vinayeq opened 5 years ago
The reason for this error is that in Python 3, strings are Unicode, but when transmitting on the network, the data needs to be bytes strings instead.
In pickle.load function, the parameter "r" should be replaced with "rb".
like this ,
ages = pickle.load( open("practice_outliers_ages.pkl", "rb") )
net_worths = pickle.load( open("practice_outliers_net_worths.pkl", "rb") )
The reason for this error is that in Python 3, strings are Unicode, but when transmitting on the network, the data needs to be bytes strings instead. In pickle.load function, the parameter "r" should be replaced with "rb". like this ,
ages = pickle.load( open("practice_outliers_ages.pkl", "rb") )
net_worths = pickle.load( open("practice_outliers_net_worths.pkl", "rb") )
then a issues will happen: UnpicklingError: the STRING opcode argument must be quoted
No directory found word_data_unix.pkl
File "F:/github/ud120-projects/decision_tree/dt_author_id.py", line 20, in
Process finished with exit code 1
I got the same issues saying File "nb_author_id.py", line 10, in
Hello every1 in Win10 this fixed it: Remember when openning the file as well it has to be read as bytes:
authors_file_handler = open(authors_file, "rb")
words_file_handler = open(words_file, "rb")
PowerShell: $path = "\word_data.pkl" (Get-Content $path -Raw).Replace("`r`n","`n") | Set-Content $path -Force
(add you whole path to avoid issues)
This is for Win10
My solution was just to add the whole path from my PC to the joblib.load
command.
Remember to change /
to \\
TypeError Traceback (most recent call last)