0
votes

help me please

Traceback (most recent call last): File "E:/Speaker-Identification-Python-master/Speaker-Identification-Python-master/modeltraining.py", line 49, in cPickle.dump(gmm, open(dest + picklefile, 'w')) TypeError: write() argument must be str, not bytes

1
You should include more context with your question, such as the relevant portion of modeltraining.py, and explain more of what you're trying to accomplish. That being said, you may be able to overcome this particular error by opening your file in byte mode ('wb') - smokes2345

1 Answers

0
votes

Simple. You are using the wrong file mode for pickling. Pickling converts objects to bytes, not string. The 'w' or 'write' mode will open the file in string mode. Change it to 'wb' to open the file in the 'write-binary' mode. Change cPickle.dump(gmm, open(dest + picklefile, 'w')) to cPickle.dump(gmm, open(dest + picklefile, 'wb'))