I'm trying to save a sklearn model on azure blob storage.
I have no issue to save it and use it locally :
pickle.dump(random_forest, open("mymodel.pkl", 'wb'))
model = pickle.load(open("mymodel.pkl", "rb"))
==>This works like a charm.
But whenever i am trying to save it on azure blob storage, i cannot read it :
model= pickle.dumps(random_forest_model)
blobService.create_blob_from_bytes(containerName, 'random_forest_model.pickle',model)
model= blobService.get_blob_to_bytes(containerName,'random_forest_model.pickle').content
model = pickle.load(open(model, "rb"))
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) in 1 import pickle ----> 2 model = pickle.load(open(model, "rb"))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
I have read several other answers, without success. I have tried "error ignore", but i get the same error log. error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte Python: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
I am using azure-storage==0.36. For text files, it works very well.
from azure.storage.blob import BlockBlobService, PublicAccess
Any observation or suggestion would be highly appreciated!