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

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

Open
Fengxuxu opened this issue Jul 27, 2023 · 5 comments

Comments

@Fengxuxu
Copy link

发生异常: 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.

@xiaxin1998
Copy link
Owner

do you change the codes?

@onetance
Copy link

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

@fgriver
Copy link

fgriver commented Aug 26, 2024

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

@onetance
Copy link

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

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

@fgriver
Copy link

fgriver commented Sep 5, 2024

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问题解决后并没有成功复现出实验结果。

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

4 participants