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

ValueError: setting an array element with a sequence. @ create extractive label #5

Open
adibenc opened this issue Mar 14, 2023 · 0 comments

Comments

@adibenc
Copy link

adibenc commented Mar 14, 2023

Error

I had errors when try to run 2_create_extractive_label.py. I don't know if this is normal or not. The source of error from the thrown err below is this: article = np.array(data['clean_article'][:MAX_SENTENCE]). I think each sentence has a different length and it tries to make square np.array, so the error is thrown. What should be the solution?

Process Process-1:
Traceback (most recent call last):
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 105, in run_thread
    data = find_label(f)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 58, in find_label
    article = np.array(data['clean_article'][:MAX_SENTENCE])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (17,) + inhomogeneous part.
Process Process-2:
Traceback (most recent call last):
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 105, in run_thread
    data = find_label(f)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 58, in find_label
    article = np.array(data['clean_article'][:MAX_SENTENCE])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (7,) + inhomogeneous part.
Process Process-3:
...
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

1 participant