-
Notifications
You must be signed in to change notification settings - Fork 15
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
quickstart.ipynb indicates we can train bnn and fnn without other parameters but I get error: UnboundLocalError: local variable 'labels' referenced before assignment #263
Comments
@jamil2388 @rezaBarzgar @thangk can any of you look into this and support @littlebeanbean7 . thank you. |
Hi @hosseinfani, Instead of using quickstart.ipynb, I guess the OpeNTF.ipynb is a more suitable started now, as it was updated very recently (5 months ago), compared to the quickstart.ipynb (2 years+ ago). Let me know the suggestions based on your experience please. Thanks! |
Hi @jamil2388 thank you for your reply! I looked into OpeNTF.ipynb, it seems contradicts with itself: it says -fairness and -attribute are "optional arguments", however, if I remove the 2 parameters, I get error: UnboundLocalError: local variable 'labels' referenced before assignment. |
Hi @littlebeanbean7, we are trying to find out the origin of the problem. We will reach back to you after resolution. Thank you for your patience! |
@jamil2388 thanks for the hint. @Hamedloghmani Line 70 in 7905ad3
it should not load any package for the Adila. However, due to this line, it does! https://github.com/fani-lab/OpeNTF/blob/7905ad34028cdec5db661a3bf8e45e158fd6e816/src/main.py#L209C5-L209C118 |
Hi @hosseinfani , |
https://github.com/fani-lab/OpeNTF/blob/main/quickstart.ipynb shows that we can run
python main.py -data ../data/raw/dblp/toy.dblp.v12.json -domain dblp -model bnn
python main.py -data ../data/raw/dblp/toy.dblp.v12.json -domain dblp -model fnn
but both of the models will get error message below. I found only if I add "-fairness det_greedy -attribute popularity", this error would disappear -- this contradicts with the quickstart.ipynb.
Traceback (most recent call last):
File "main.py", line 210, in
run(data_list=args.data_list,
File "main.py", line 167, in run
m_obj.run(splits, vecs_, indexes, f'{output_path}', settings['model']['baseline'][baseline_name], settings['model']['cmd'], settings['fair'], merge_skills=False)
File "/mnt/data/lingling/OpeNTF/src/mdl/ntf.py", line 141, in run
if 'fair' in cmd: self.fair(output, vecs, splits, fair_settings)
File "/mnt/data/lingling/OpeNTF/src/mdl/ntf.py", line 88, in fair
for fpred, output in pairs: adila.Reranking.run(fpred=fpred,
File "/mnt/data/lingling/OpeNTF/src/Adila/src/main.py", line 350, in run
stats, labels, ratios = Reranking.get_stats(teamsvecs, coefficient=1, output=output, eq_op=eq_op, att=att)
File "/mnt/data/lingling/OpeNTF/src/Adila/src/main.py", line 98, in get_stats
return stats, labels, None
UnboundLocalError: local variable 'labels' referenced before assignment
The text was updated successfully, but these errors were encountered: