I've trained a Sagemaker XGBoost model and downloaded the model.tar.gz file from S3 onto my local machine. How can I load this model for deploying it using flask?
I've tried using pickle to load the unzipped model file but it doesn't seem to work.
import sagemaker
import boto3
import os
import pickle
with open('xgboost-model', 'r') as inp:
cls.model = pkl.load(inp)
Traceback (most recent call last): File "", line 2, in File "C:\Anaconda3\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 969: character maps to