Skip to content

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

@XSskeX

Description

@XSskeX

Hello, boathit. I tried to follow your jupyter notebook but I encountered some problems in Exp1 In[12]. I hope to get your answer. When I progressed to "run(t2vec)", it reminded me to set vocab_size to 18866 rather than 18864. After I did this, it reminded me of the following errors:
Traceback (most recent call last):
File "/mnt/c/Users/HP/Desktop/Work/t2vec-master/t2vec.py", line 119, in
t2vec(args)
File "/mnt/c/Users/HP/Desktop/Work/t2vec-master/evaluate.py", line 94, in t2vec
src, lengths, invp = scaner.getbatch()
^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/HP/Desktop/Work/t2vec-master/data_utils.py", line 287, in getbatch
return pad_arrays_keep_invp(src)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/HP/Desktop/Work/t2vec-master/data_utils.py", line 84, in pad_arrays_keep_invp
src = list(np.array(src)[idx])
^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected sh
ape was (256,) + inhomogeneous part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions