-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
I have modified "convolutional_mlp.py" file so that I can pickle the cnn class's object which will further help me to predict the classes of image using the saved model.But I am getting an error while doing so in the line-377 where I am actually calling the pickle.dump() method.
I am attaching the code for the file and the screenshot of the error.I guess the error is due to pickling the instance methods of logistic_sgd(though I am not sure about it)
self.layer3 = LogisticRegression(input=self.layer2.output, n_in=500, n_out=10)
self.negative_log_likelihood = (
self.layer3.negative_log_likelihood
)
#predicting the calss value and calculating errors
self.predict=self.layer3.y_pred
self.errors = self.layer3.errors
# the cost we minimize during training is the NLL of the model
#self.cost = self.layer3.negative_log_likelihood(y)
# create a list of all model parameters to be fit by gradient descent
self.params = self.layer3.params + self.layer2.params + self.layer1.params + self.layer0.params
self.input = input