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

error when use 'nbdt-hierarchy' #14

Open
zhuyi3625 opened this issue Mar 13, 2021 · 4 comments
Open

error when use 'nbdt-hierarchy' #14

zhuyi3625 opened this issue Mar 13, 2021 · 4 comments

Comments

@zhuyi3625
Copy link

when run command 'nbdt-hierarchy' in ubuntu 18.04
nbdt-hierarchy --checkpoint=wrn28_10_cifar10 --dataset=CIFAR10
nbdt-hierarchy --vis-sublabels --vis-zoom=1.25 --dataset=CIFAR10 --arch=wrn28_10_cifar10

Here is ModuleNotFoundError: No module named 'nbdt.thirdparty',
I wonder what happened

@alvinwan
Copy link
Owner

Is your system default python3? I just tried pip install nbdt (installing nbdt-0.0.4) and nbdt-hierarchy --help works for me on Ubuntu 18.04. However, I ran this from within a conda environment with a python3 default.

@zhuyi3625
Copy link
Author

Is your system default python3? I just tried pip install nbdt (installing nbdt-0.0.4) and nbdt-hierarchy --help works for me on Ubuntu 18.04. However, I ran this from within a conda environment with a python3 default.

Traceback (most recent call last):
File "/data/anaconda3/bin/nbdt-hierarchy", line 7, in
exec(compile(f.read(), file, 'exec'))
File "/data/M808/zhuyi/NBDTNemaTest/nbdt/bin/nbdt-hierarchy", line 5, in
from nbdt.thirdparty.wn import maybe_install_wordnet
ModuleNotFoundError: No module named 'nbdt.thirdparty'

It's the full error tips

@alvinwan
Copy link
Owner

Thanks for your traceback, but same question -- is your environment using python2 or python3? I was able to setup the repository inside a conda environment with python3 successfully, using the below:

conda create -n nbdt python=3.7
git clone git@github.com:alvinwan/neural-backed-decision-trees.git  # or use https to clone
cd neural-backed-decision-trees
python setup.py develop
nbdt-hierarchy --help

@zhuyi3625
Copy link
Author

zhuyi3625 commented Mar 16, 2021

Thanks for your traceback, but same question -- is your environment using python2 or python3? I was able to setup the repository inside a conda environment with python3 successfully, using the below:

conda create -n nbdt python=3.7
git clone git@github.com:alvinwan/neural-backed-decision-trees.git  # or use https to clone
cd neural-backed-decision-trees
python setup.py develop
nbdt-hierarchy --help

Pre-use is python3.8,torch 1.8 and torchvision 0.9,
I changed it to python3.7,torch1.6,and torchvision 0.7,
now it works!

But there still an unexpected question,
using command nbdt-wnids --dataset=CIFAR10,
error tips,
Traceback (most recent call last):
File "/data/anaconda3/envs/nbdt/bin/nbdt-wnids", line 7, in
exec(compile(f.read(), file, 'exec'))
File "/data/M808/zhuyi/NBDTNemaTest/nbdt/bin/nbdt-wnids", line 49, in
print('keys',data.custom.keys)
AttributeError: module 'nbdt.data.custom' has no attribute 'keys'

there is no attribute 'keys' in custom.py

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

2 participants