nok / sklearn-porter

Transpile trained scikit-learn estimators to C, Java, JavaScript and others.
BSD 3-Clause "New" or "Revised" License
1.29k stars 170 forks source link

When I run this, I got ValueError: level must be >= 0 #3

Closed zxch3n closed 7 years ago

zxch3n commented 7 years ago

I installed this by python setup.py install

I used python 3

$ python -m sklearn_porter --input cl.pkl --language java

Traceback (most recent call last):
  File "/home/rem/anaconda3/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/rem/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/rem/anaconda3/lib/python3.5/site-packages/sklearn_porter-0.2.0-py3.5.egg/sklearn_porter/__main__.py", line 54, in <module>
    main()
  File "/home/rem/anaconda3/lib/python3.5/site-packages/sklearn_porter-0.2.0-py3.5.egg/sklearn_porter/__main__.py", line 35, in main
    result = porter.port(raw_model)
  File "/home/rem/anaconda3/lib/python3.5/site-packages/sklearn_porter-0.2.0-py3.5.egg/sklearn_porter/__init__.py", line 50, in port
    locals(), [md_name], -1)
ValueError: level must be >= 0
zxch3n commented 7 years ago

Must it run in python2 environment?

nok commented 7 years ago

Thanks @rem2016 ,

it's fixed with https://github.com/nok/sklearn-porter/commit/a50e6cf760ee4db7f6e9f39c300577b5ca932478 and released under version 0.2.1 as patch update.

Happy coding, Darius