JSmith
JSmith

Reputation: 135

Saving a file in AWS filesystem

Hi I am trying out opencv in AWS lambda. I want to save a SVM model in txt file so that I can load it again. Is it possible to save it in tmp directory and load it from there whenever I need it or will I have to use s3?

I am using python and trying to do something like this:

# saving the model
svm.save("/tmp/svm.dat")
# Loading the model
svm = cv2.ml.SVM_load("/tmp/svm.dat")

Upvotes: 2

Views: 96

Answers (1)

joarleymoraes
joarleymoraes

Reputation: 1949

Its not possible as Lambda execution environment is distributed and therefore the same function might run on several different instances.

The alternative is to save your svm.dat to S3 and then download it every time you start your lambda function.

Upvotes: 2

Related Questions