Python learner in rapidminer for deep learning

Pradeep_Jedi123Pradeep_Jedi123 MemberPosts:6Newbie
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

  • MichaelKnopfMichaelKnopf Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:31RM Data Scientist
    Solution Accepted
    请看附呈的修改版本the first tutorial process of the Python Leaner. It will use thejoblibmodule to store the model next to the process file asmodel.joblib.The same should work withh5.
    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.
    MartinLiebig Pradeep_Jedi123

Answers

  • MichaelKnopfMichaelKnopf Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:31RM 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.
  • Pradeep_Jedi123Pradeep_Jedi123 MemberPosts:6Newbie
    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 InorRegisterto comment.