Artificial Neural Networks and Deep Learning 2022 - Homework 2 Forum

Go back to competition Back to thread list Post in this thread

> Load scaler into model.py pre-processing

Hello!

I'm having problem with the scaler (for data standardization), I don't know how to load my saved scaler in the model.py file, I've tried to create one folder Model and another Scaler inside the SubmissionModel folder and implement the following code inside the function __init__:

self.model = tf.keras.models.load_model(os.path.join(path, 'SubmissionModel/Model'))
self.scaler = np.load(open(os.path.join(path, 'SubmissionModel/Scaler')), allow_pickle=True) #i used np.load because the libraries pickle and joblib are not allowed

However, it didn't work. I also tried different approaches (such as putting the model and the scaler in the same folder or creating a SubmissionScale folder) but it is still not working.

Is there any other way to do this? I don't know where to save the scaler file inside the .zip file

Posted by: pedrohgian @ Dec. 15, 2022, 8:17 p.m.

I have the same question

Posted by: julia.bujosa @ Dec. 17, 2022, 6:09 p.m.
Post in this thread