can't convert np.ndarray of type numpy.object_

77 views Asked by At

i'm trying to construct a dynamic heterogeneous graph by dgl and torch.however,it's failes. Ive tried multiple variations of this, but none of them seem to work. Any ideas?

Here's the full error message:

Traceback (most recent call last):
  File "D:\PythonProjects\GNNtest\venv\TGCN.py", line 124, in <module>
    graph = create_graph(data, num_nodes=num_nodes)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PythonProjects\GNNtest\venv\TGCN.py", line 109, in create_graph
    dst_shareholder = th.tensor(data['shareholder'].values)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.

Process finished with exit code 1

i've transformed all the node data into int32.What could be causing this error, and how can I figure it out and construct the graph?

0

There are 0 answers