BUPT-GAMMA / OpenHGNN

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attribute error

faizan1234567 opened this issue · comments

I am training HetGNN model for node classification. when i try to run the script for training. I get the following error. Please help me
AttributeError: 'dict' object has no attribute 'srcdata'

its from HetGNN_sampler.py

Please help me

There is the same error in #64.
It is a version problem. DGL has a new API in the new version.
We will fix it later. If you are urgent, install the 0.7.0 version DGL. https://data.dgl.ai/wheels/repo.html

Thank you so much for the reply. let me check it.

!pip install dgl-cu113 dglgo -f https://data.dgl.ai/wheels/dgl-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
i did this, the issue still persists

I am using google colab

Before installing the dgl-0.7.0, make sure that the old version has been uninstalled.
I have tried to run it in V0.8 and got the same error.
In v0.7.0, I have tried to run it and there is no error.

I Uninstalled v0.8, when I try to install version 0.7 with this pip command, it gives me an error. I don't why?
I am using this pip command
!pip install dgl-cu113-f https://data.dgl.ai/wheels/dgl-0.7.0-cp37-cp37m-manylinux1_x86_64.whl

and It gives me the following error.
Looking in links: https://data.dgl.ai/wheels/dgl-0.7.0-cp37-cp37m-manylinux1_x86_64.whl
WARNING: Skipping page https://data.dgl.ai/wheels/dgl-0.7.0-cp37-cp37m-manylinux1_x86_64.whl because the HEAD request got Content-Type: binary/octet-stream.The only supported Content-Type is text/html
ERROR: Could not find a version that satisfies the requirement dgl-cpu (from versions: none)
ERROR: No matching distribution found for dgl-cpu

do you have a pip command to install v0.7.0 and uninstall v0.8?

It seems that you want to install dgl-cu113, but your URL is the CPU version.
I think it should be
pip install dgl-cu113-f https://data.dgl.ai/wheels/dgl_cu113-0.7.1-cp37-cp37m-manylinux1_x86_64.whl
I just install the CPU version, so my command line is
pip install dgl -f https://data.dgl.ai/wheels/dgl-0.7.1-cp37-cp37m-manylinux1_x86_64.whl.
Besides, he 0.7.0 or 0.7.1 is both OK. But it seems that dgl-cu113 only has 0.7.1 version.

!pip install dgl-cu113 -f https://data.dgl.ai/wheels/dgl_cu113-0.7.1-cp37-cp37m-manylinux1_x86_64.whl

it results in the following error. I am running it on colab

Looking in links: https://data.dgl.ai/wheels/dgl_cu113-0.7.1-cp37-cp37m-manylinux1_x86_64.whl
WARNING: Skipping page https://data.dgl.ai/wheels/dgl_cu113-0.7.1-cp37-cp37m-manylinux1_x86_64.whl because the HEAD request got Content-Type: binary/octet-stream.The only supported Content-Type is text/html
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/base_command.py", line 180, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/req_command.py", line 199, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/commands/install.py", line 319, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/resolution/resolvelib/resolver.py", line 128, in resolve
requirements, max_rounds=try_to_avoid_resolution_too_deep
File "/usr/local/lib/python3.7/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 473, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.7/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 341, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "/usr/local/lib/python3.7/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _merge_into_criterion
if not criterion.candidates:
File "/usr/local/lib/python3.7/dist-packages/pip/_vendor/resolvelib/structs.py", line 139, in bool
return bool(self._sequence)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in bool
return any(self)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 129, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 30, in _iter_built
for version, func in infos:
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 272, in iter_index_candidate_infos
hashes=hashes,
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/index/package_finder.py", line 879, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/index/package_finder.py", line 838, in find_all_candidates
paths = [url_to_path(c.link.url) for c in file_candidates]
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/index/package_finder.py", line 838, in
paths = [url_to_path(c.link.url) for c in file_candidates]
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/utils/urls.py", line 33, in url_to_path
), f"You can only turn file: urls into filenames (not {url!r})"
AssertionError: You can only turn file: urls into filenames (not 'https://data.dgl.ai/wheels/dgl_cu113-0.7.1-cp37-cp37m-manylinux1_x86_64.whl')

It should be

pip install dgl-cu113 -f https://data.dgl.ai/wheels/repo.html

If you want to install specific version, you'll need to remove the -f flag.

OpenHGNN also fix the bug in 97eae6e.
It has been tested in DGLv0.8.1

Thank you, now it works.