TypeError: can't pickle face_BasicFaceRecognizer objects
<p>I want to store the trained object, however there is an error shown above. What should I do if I need to store this trained model?</p>

<pre><code>fishface = cv2.face.createFisherFaceRecognizer() 
m = fishface.train(training_data, np.asarray(training_labels))
output = open('data.pkl', 'wb')
pickle.dump(fishface, output)
</code></pre>

<p>Unfortunately, OpenCV bindings typically don't support pickling. You'll have to use built-in OpenCV serialization.</p>

<p>You can do <code>m.save("serialized_recognizer.cv2")</code> and at runtime, <code>m.load("serialized_recognizer.cv2")</code>, if <code>m</code> is an instantiated FaceRecognizer.</p>

python opencv pickle