GithubHelp home page GithubHelp logo

Comments (2)

vruusmann avatar vruusmann commented on August 20, 2024

SEVERE: Failed to parse PKL net.razorvine.pickle.InvalidOpcodeException: invalid pickle opcode: 248

JPMML-SkLearn depends on the Pyrolite library for low-level PKL file parsing functionality. Apparently, Pyrolite does not recognize Pickle protocol opcode 248 (hex 0xf8).

I can't find the definition of this opcode in Python 3.6 codebase:
https://github.com/python/cpython/blob/3.6/Lib/pickle.py#L102-L179

Could you give me pointers on where I might be looking to solve this error?

The stack trace of this exception points at method net.razorvine.pickle.Unpikcler#dispatch(short). You could try addinng a case statement for opcode 248 there, and collect more information about it (eg. which Scikit-Learn class, which class attribute, etc.). Then, try to factor a minimal reproducible example, and open a parallel issue with the Pyrolite project: https://github.com/irmen/Pyrolite/issues

The JPMML-SkLearn project includes an integration test for the IsolationForest model type:
https://github.com/jpmml/jpmml-sklearn/blob/master/src/test/resources/pkl/IsolationForestHousingAnomaly.pkl

This PKL file was generated using Python 3.4(.3). So, downgrading from Python 3.6 to 3.4 may provide a temporary workaround.

from sklearn2pmml.

dverstee avatar dverstee commented on August 20, 2024

Thanks for the quick update.

I ran the code with python 3.4 and I have it confirmed working ! You are great man ! 👍

When running your debug pointer I noticed that all tree models are affected, but others not.
For now I'll use python 3.4 as a workaround and I'll close the Issue.

Thanks again.

from sklearn2pmml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.