Cannot serialize faiss indexes

Hello.
How can I serialize SwigPyObject object? Working with bert model I use faiss library to search similar item. Unfortunatelly I have found that I cannot save my object in order to use later:

indexes = faiss.IndexIDMap(faiss.IndexFlatL2(768))
....... some code....................
pickle.dump(indexes, open(filename + '.bin', 'wb')

TypeError: can’t pickle SwigPyObject objects