[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sklearn_to_hls.py example issues #2

Open
cgsavard opened this issue May 15, 2020 · 3 comments
Open

sklearn_to_hls.py example issues #2

cgsavard opened this issue May 15, 2020 · 3 comments

Comments

@cgsavard
Copy link

I just downloaded the package and went to run the sklearn_to_hls.py in the example directory but ran into a few issues. To run, I did "python sklearn_to_hls.py". Here were the issues and my current solutions that you may want to consider including:

Error 1: import conifer ModuleNotFoundError: No module named 'conifer'
Solution 1: Include init.py script in the top directory where the conifer directory is so that is can be seen as a package, then move the sklearn_to_hls.py script to the same top directory and run. There may be a better solution here, but in general the scripts in the examples directory cannot see the conifer directory and the conifer directory is not currently viewed as a package by python.

Error 2: y_hls = model.decision_function(X)[:,0] IndexError: too many indices for array
Solution 2: y_hls is a 1D array so the [:,0] was the issue here. If you take this out then the issue is fixed. Every other script in example does not have [:,0] after model.decision_function so this is the only place where this will need to be fixed.

I can submit a pull request for my solution to error 2. For error 1, perhaps you have a better solution?

@thesps
Copy link
Owner
thesps commented May 18, 2020

Thanks for the comments, and the PR, I've merged it!

On Error 1, did you pip install . in the root directory of the project? That should make the package available to be imported everywhere. (I recommend pip install -e . if you will be editing the package files to make the changes available when you import)

@cgsavard
Copy link
Author

Yes, I used "python -m pip install ." to make sure it installed with my current python version (python 3.6.8). Then running "python examples/sklearn_to_hls.py" gives the same error "no module names conifer".

@xu-jiachen
Copy link

I had the same issue. Using pip install -e . worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants