Options

Python learner in rapidminer for deep learning

Pradeep_Jedi123Pradeep_Jedi123 Member Posts: 6 Newbie
Hi
I am trying to use python learner operator for training a deep learning unsupervised model after the i fit my model i am trying to return the model object but getting error cannot pickle weak ref object , i understand we cannot pickle the deeplearning model instead we need to save them in h5 objects. But want to know is the python learner by default trying to pickle the model? If so can we not use python learner for deep learning?

Best Answer

  • Options
    MichaelKnopfMichaelKnopf Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 31 RM Data Scientist
    Solution Accepted
    See attached a modified version of the first tutorial process of the Python Leaner. It will use the joblib module to store the model next to the process file as model.joblib.The same should work with h5.
    Please take note that you might need to refresh the repository panel after running the process to see the model file. Also make sure to save the process in a project repository or local repository before running it, otherwise the model will end up in a temporary folder.

Answers

  • Options
    MichaelKnopfMichaelKnopf Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 31 RM Data Scientist
    You are correct that the operator tries to serialize the returned Python object. You could try to work around this by returning a dictionary with a path to a previously written H5 file instead. You can use relative paths: the current working directory will be the process location. E.g., model.save('model.h5') should place the file next to the process file.Β 
  • Options
    Pradeep_Jedi123Pradeep_Jedi123 Member Posts: 6 Newbie
    Thank you for the response could you please provide a sample how the return statement line will be with a dictionary considering the h5 model is "model.h5" and it is next to the process file in same directory
Sign In or Register to comment.