Reputation: 686
I am training an ALS model using a dataset. I am trying to save this model and later retrieve it and use it to get predictions. I can save the model but when trying to retrieve it get an error as IllegalAccessError: tried to access method com.google.common.base.Stopwatch.<init>()V from class org.apache.hadoop.mapred.FileInputFormat
.
My code is as below:
MatrixFactorizationModel model;
MatrixFactorizationModel sameModel;
int rank = 10;
int numIterations = 10;
model = ALS.train( JavaRDD.toRDD( ratings ), rank, numIterations, 0.01 );
model.save( sc.sc(), "src/main/resources/UserBasedModel" );
sameModel = MatrixFactorizationModel.load( sc.sc(), "src/main/resources/UserBasedModel" );
The stack trace is as below:
How can I solve this? Any help is appreciated.
Upvotes: 1
Views: 433