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

[BUG] GraphLearn doesn't work with Python 3.10 & Python 3.11 #2391

Closed
sighingnow opened this issue Jan 18, 2023 · 5 comments
Closed

[BUG] GraphLearn doesn't work with Python 3.10 & Python 3.11 #2391

sighingnow opened this issue Jan 18, 2023 · 5 comments

Comments

@sighingnow
Copy link
Collaborator

Describe the bug

GraphLearn requires a fairly low version of tensorflow (currently 2.5.2 in our CI) which is not compatible with Python 3.10 and Python 3.11.

We'll release the wheel packages for Python 3.{10,11} to pypi and that would be a concern if user tries to play with the GLE part with recently Python distributions.

For detail error message, just trying pip3 install grpahscope>=0.19.0 tensorflow in Python 3.{10,11} environments and try the demo in README.

Additional context
Add any other context about the problem here.

@goldenleaves
Copy link
Contributor

I reproduced this example with ubuntu 22.04 and Python 3.10, and got the following error info:

Traceback (most recent call last):
  File "/root/workdir/codelab/test_gle.py", line 104, in <module>
    train_gcn(lg, node_type="paper", edge_type="cites",
  File "/root/workdir/codelab/test_gle.py", line 73, in train_gcn
    train_data = EgoSAGESupervisedDataLoader(
  File "/root/workdir/pip/graphscope/graphscope/learning/examples/tf/ego_sage/ego_sage_data_loader.py", line 47, in __init__
    super().__init__(graph, mask, sampler, batch_size, window)
  File "/root/workdir/pip/graphscope/graphscope/learning/examples/tf/ego_data_loader.py", line 54, in __init__
    self._dataset = tfg.Dataset(self._q, window=window)
  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/tf/data/dataset.py", line 64, in __init__
    self._iterator = self._make_iterator()
  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/tf/data/dataset.py", line 167, in _make_iterator
    output_types, output_shapes = self._raw_flatten_types_and_shapes()
  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/tf/data/dataset.py", line 183, in _raw_flatten_types_and_shapes
    types, shapes = self._data_types_and_shapes(node.decoder, 
  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/tf/data/dataset.py", line 236, in _data_types_and_shapes
    feat_shapes = np.array([tf.TensorShape([None, node_decoder.int_attr_num]),
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Is this consistent with the problem you encountered? @sighingnow

@goldenleaves
Copy link
Contributor

I have located the problem and will fix it as soon as possible

@sighingnow
Copy link
Collaborator Author

After fixing the above error, new tensorflow related error would appear.

Thanks!

@goldenleaves
Copy link
Contributor

@sighingnow
Another error is located in https://github.com/alibaba/graph-learn/blob/711f67796162ab6ade24cd6ebac504488150b381/graphlearn/python/nn/dataset.py#L97
and the related error info is:

Traceback (most recent call last):

  File "/root/workdir/pip/tensorflow/tensorflow/python/ops/script_ops.py", line 271, in __call__
    ret = func(*args)

  File "/root/workdir/pip/tensorflow/tensorflow/python/autograph/impl/api.py", line 642, in wrapper
    return func(*args, **kwargs)

  File "/root/workdir/pip/tensorflow/tensorflow/python/data/ops/dataset_ops.py", line 1039, in generator_py_func
    values = next(generator_state.get_iterator(iterator_id))

  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/tf/data/dataset.py", line 193, in _raw_flatten_generator
    yield tuple(self._rds.get_flatten_values())

  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/dataset.py", line 104, in get_flatten_values
    res.extend(parse_value(value, masks))

  File "/root/workdir/pip/graphscope/graphscope/learning/graphlearn/python/nn/dataset.py", line 97, in parse_value
    return list(np.array(values)[feat_masks + id_masks + sparse_masks])

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part.

I will fix it together.

@goldenleaves
Copy link
Contributor

fixed with alibaba/graph-learn#249

@LiSu LiSu closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants