t2vec icon indicating copy to clipboard operation
t2vec copied to clipboard

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions.

Open Gshaoo opened this issue 2 years ago • 3 comments

Hello, boathit, I am a beginner in trajectory mining. When I was training, I encountered a problem that could not be solved. I hope to get your answer. The problem is : Traceback (most recent call last): File "t2vec.py", line 121, in train(args) File "/home/ubuntu/gsh/t2vec-master/train.py", line 177, in train trainData.load(args.max_num_line) File "/home/ubuntu/gsh/t2vec-master/data_utils.py", line 155, in load self.srcdata = list(map(np.array, self.srcdata)) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5453003,) + inhomogeneous part.

Gshaoo avatar Mar 28 '23 12:03 Gshaoo

Hello Gshaoo, I also encountered the same problem, did you solve the problem?

Jyl595 avatar May 29 '23 06:05 Jyl595

Hi, I solve it when I use numpy 1.23

liuwj2000 avatar Nov 02 '23 12:11 liuwj2000

you can solve this problem by: self.srcdata = list(map(np.array, self.srcdata)) --> self.srcdata = [np.array(e, dtype=object) for e in self.srcdata]

csjiezhao avatar Jan 02 '24 08:01 csjiezhao