April 19, 2022, 2:09 a.m. | Wesley Cheek

DEV Community dev.to

After a lot of struggle doing this, I finally found a simple way.


We can write and read Tensorflow and sklearn models/pipelines using joblib.





Local Write / Read



from pathlib import Path
path = Path(<local path>)

# WRITE
with path.open("wb") as f:
joblib.dump(model, f)

# READ
with path.open("rb") as f:
f.seek(0)
model = joblib.load(f)


We can do the same thing on AWS S3 using a boto3 client:





AWS S3 Write / Read



import tempfile
import boto3
import joblib

s3_client = …

aws machinelearning pipelines s3 sklearn tensorflow

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York

AI Engineer Intern, Agents

@ Occam AI | US