DHCN icon indicating copy to clipboard operation
DHCN copied to clipboard

Do you have such an error "ValueError: setting an array element with a sequence" when you run the code?

Open Fengxuxu opened this issue 2 years ago • 6 comments

发生异常: ValueError setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (719470,) + inhomogeneous part. File "/17119/mf/models/DHCN/util.py", line 43, in init self.raw = np.asarray(data[0]) ^^^^^^^^^^^^^^^^^^^ File "/17119/mf/models/DHCN/main.py", line 41, in main train_data = Data(train_data, shuffle=True, n_node=n_node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/17119/mf/models/DHCN/main.py", line 72, in main() ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (719470,) + inhomogeneous part.

Fengxuxu avatar Jul 27 '23 03:07 Fengxuxu

do you change the codes?

xiaxin1998 avatar Aug 07 '23 05:08 xiaxin1998

Hello, I also met the same problem, may I ask you to solve it?

onetance avatar Apr 21 '24 11:04 onetance

hello, I also met this problem and I have no idea to solve it, have u solved this problem successfully?

fgriver avatar Aug 26 '24 10:08 fgriver

hello, I also met this problem and I have no idea to solve it, have u solved this problem successfully?

将服务器的配置调整成和作者一样的可以解决

onetance avatar Aug 27 '24 07:08 onetance

hello, I also met this problem and I have no idea to solve it, have u solved this problem successfully?

将服务器的配置调整成和作者一样的可以解决

您好,根据文章的配置“Python3, Pytorch 1.6.0, Numpy 1.18.1, numba”,我的服务器上cuda版本过高无法配置torch1.6,但通过降低numpy版本成功解决了ValueError问题,我想请问您针对文章中多次tensor -> numpy没有进行detach()操作您是如何解决的呢?是否能够成功复现论文中的实验结果?期待您的回复。ps:我将code中所报的device问题和type问题解决后并没有成功复现出实验结果。

fgriver avatar Sep 05 '24 13:09 fgriver