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

XGBoost feature error #23

Closed
maziar840 opened this issue May 25, 2022 · 4 comments · Fixed by #26
Closed

XGBoost feature error #23

maziar840 opened this issue May 25, 2022 · 4 comments · Fixed by #26

Comments

@maziar840
Copy link

maziar840 commented May 25, 2022

Hi all,

I am trying to do:

cnf = conifer.model(clf._Booster, conifer.converters.xgboost, conifer.backends.vivadohls, cfg)
cnf.compile()

But I get:

     82       data = node.split('<').     
---> 83       feature = int(data[0].split('[')[-1].replace('f','')).     
     84       threshold = float(data[1].split(']')[0]).      
     85       child_left = int(node.split('yes=')[1].split(',')[0]).    

ValueError: invalid literal for int() with base 10: 'busy_cycles'

Printing 'node' I have:
0:[busy_cycles<299923] yes=1,no=2,missing=1

busy_cycles is the name of a feature in my dataset. Is line 83 trying to convert it to int?

@thesps
Copy link
Owner

thesps commented May 30, 2022

Hi, looks like I overlooked the case for named features, and only supported the case where they are automatically given names like 'f0', 'f1', etc. Could you try the branch xgb-named-features with a proposed fix (link)?

@maziar840
Copy link
Author

Thanks. I will test it and will get back to you.

@maziar840
Copy link
Author

@thesps Thanks it worked. Compile and build stages passed. However, when I import hls4ml, to use hls4ml.report.read_vivado_report() I get:

   1026           raise RuntimeError('Please link in cpp generated lib for %s' % (name))
   1027       elif serialized_pb:
-> 1028         return _message.default_pool.AddSerializedFile(serialized_pb)
   1029       else:
   1030         return super(FileDescriptor, cls).__new__(cls)

TypeError: Couldn't build proto file into descriptor pool: duplicate file name (onnx/onnx-ml.proto)

Have you seen this problem before?

@thesps
Copy link
Owner

thesps commented Jun 7, 2022

Thanks for the feedback, I've added that fix to the master branch.
Regarding the new error, I don't recognise it, which file is that from? Looks like something onnx related

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

Successfully merging a pull request may close this issue.

2 participants