I was getting the same error when the code was open(filname). Following the discussion here, Python pickle error: UnicodeDecodeError
I changed it to open(filname, 'rb'). I am still getting the error.
/Users/sheetalpandrekar/Google Drive/Research/Health-care Analytics/Twitter/Opioid/TwitterUserType/PrepareData/Twitter_User_Types/Classifier/TwoPhaseTwitterClassifier2.py in loadClassifierFromFile(self, class1, class2)
32
33 def loadClassifierFromFile(self,class1,class2):
---> 34 self.clf1=pickle.load(open(class1, 'rb'))
35 self.clf2=pickle.load(open(class2, 'rb'))
36 pass
/Library/anaconda/lib/python3.5/codecs.py in decode(self, input, final)
319 # decode input (taking the buffer into account)
320 data = self.buffer + input
--> 321 (result, consumed) = self._buffer_decode(data, self.errors, final)
322 # keep undecoded input until the next call
323 self.buffer = data[consumed:]
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte