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

AttributeError: module 'graphvite' has no attribute 'dataset' #97

Open
dxlong2000 opened this issue Mar 9, 2022 · 1 comment
Open

Comments

@dxlong2000
Copy link

Hi @tangjianpku , thanks for your great work.

I have installed the module in Colab:

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!./Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local -f

!conda install -y -c milagraph -c conda-forge graphvite-mini \
  python=3.9 cudatoolkit=$(nvcc -V | grep -Po "(?<=V)\d+\.\d+")
!conda install -y wurlitzer ipykernel

import site
site.addsitedir("/usr/local/lib/python3.9/site-packages")
%reload_ext wurlitzer

and I run:

import pickle
with open("transe_wikidata5m.pkl", "rb") as fin:
    model = pickle.load(fin)
entity2id = model.graph.entity2id
relation2id = model.graph.relation2id
entity_embeddings = model.solver.entity_embeddings
relation_embeddings = model.solver.relation_embeddings

import graphvite as gv
alias2entity = gv.dataset.wikidata5m.alias2entity
alias2relation = gv.dataset.wikidata5m.alias2relation
print(entity_embeddings[entity2id[alias2entity["machine learning"]]])
print(relation_embeddings[relation2id[alias2relation["field of work"]]])

I got the error:

AttributeError: module 'graphvite' has no attribute 'dataset'

Is it possible that you could help me to check out what happened?

Thanks!

@wywy136
Copy link

wywy136 commented Jul 8, 2022

Just check the name of your python script and it should not be named as graphvite.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