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

Empty heterograph is not allowed. #6

Open
prathameshk opened this issue Apr 11, 2024 · 2 comments
Open

Empty heterograph is not allowed. #6

prathameshk opened this issue Apr 11, 2024 · 2 comments

Comments

@prathameshk
Copy link

prathameshk commented Apr 11, 2024

When I am trying to load the pretrained graph then I get following error.

TxGNN.load_pretrained('./TxGNNExplorer')

dgl._ffi.base.DGLError: [14:31:29] /tmp/dgl_src/src/graph/heterograph.cc:120: Check failed: !rel_graphs.empty(): Empty heterograph is not allowed.
The same error appears when I am trying to initialize the model.

this could be due to mistmatching version of DGL.
I am on Mac M1. So I cant install 0.5.2 version of DGL.
pip install "dgl==0.5.2"
ERROR: Could not find a version that satisfies the requirement dgl==0.5.2 (from versions: 0.9.0, 0.9.1, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.2.post1, 1.1.3, 2.0.0, 2.1.0)
ERROR: No matching distribution found for dgl==0.5.2

It seems that 0.5.2 is also not present in https://data.dgl.ai/wheels/repo.html.

Is it possible to create a new release with latest version of DGL?

@michellemli
Copy link

michellemli commented Apr 23, 2024

I encountered the same error even with dgl==0.5.2. But I realized that I did not install a cuda version of PyTorch because this error was raised (I removed the try/except statement to figure out what error was being skipped):

AssertionError: Torch not compiled with CUDA enabled

Do you have a GPU on your system? If so, did you install the cuda or cpu version of PyTorch?

Another option to check whether this is actually your error is to set the device to cpu instead of cuda.

If this is not relevant to your error, maybe try removing the try/except statement to figure out what error is actually being skipped?

===== Edit =====

FYI, I still had problems with dgl==0.5.2 because it did not have cuda enabled. I managed to get the code in the README working with dgl==0.6.1 for cuda 10.2.

@l4b4r4b4b4
Copy link

l4b4r4b4b4 commented Oct 3, 2024

I encountered the same error even with dgl==0.5.2. But I realized that I did not install a cuda version of PyTorch because this error was raised (I removed the try/except statement to figure out what error was being skipped):

AssertionError: Torch not compiled with CUDA enabled

Do you have a GPU on your system? If so, did you install the cuda or cpu version of PyTorch?

Another option to check whether this is actually your error is to set the device to cpu instead of cuda.

If this is not relevant to your error, maybe try removing the try/except statement to figure out what error is actually being skipped?

===== Edit =====

FYI, I still had problems with dgl==0.5.2 because it did not have cuda enabled. I managed to get the code in the README working with dgl==0.6.1 for cuda 10.2.

CUDA 10.2?

Is it compatible to more up-to-date versions of CUDA as well? Just trying with following base image 🤞 pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel

/EDIT

I switched to cuda 10.2 pytorch 1.8.1 and was able to load TxData successfully using the full kg.csv:

Using backend: pytorch
Found local copy...
Found local copy...
Found local copy...
Found saved processed KG... Loading...
Splits detected... Loading splits....
Creating DGL graph....
Done!

However when trying to load the pre-trained model I am stuck at loading it as follows:

TxData = TxData(data_folder_path="./data")
TxData.prepare_split(split="full_graph", seed=42, no_kg=False)
TxGNN = TxGNN(
    data=TxData,
    weight_bias_track=False,
    proj_name="TxGNN",  # wandb project name
    exp_name="TxGNN",  # wandb experiment name
    device="cuda:0",  # define your cuda device
)
logger.info(str(f"Loading pre-trained GNN model ... {repr(TxGNN)}"))
TxGNN.load_pretrained(path="/model")
logger.info(str(f"Loading pre-trained GNN model successfull! {repr(TxGNN)}"))

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