Giter Site home page Giter Site logo

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (27, 2) + inhomogeneous part. about lffont HOT 4 CLOSED

clovaai avatar clovaai commented on September 26, 2024
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (27, 2) + inhomogeneous part.

from lffont.

Comments (4)

KangyueXiong avatar KangyueXiong commented on September 26, 2024

Original Traceback (most recent call last):
File "/home/zeng/.conda/envs/xky/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/zeng/.conda/envs/xky/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/zeng/.conda/envs/xky/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/zeng/xky1/lffont-master/datasets/p1dataset.py", line 113, in getitem
trg_unis, trg_comp_ids = self.check_and_sample(trg_unis, trg_comp_ids)
File "/home/zeng/xky1/lffont-master/datasets/p1dataset.py", line 97, in check_and_sample
uni_comps = sample(uni_comps, self.n_sample_max)
File "/home/zeng/xky1/lffont-master/datasets/datautils.py", line 45, in sample
population = np.asarray(list(population))
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (23, 2) + inhomogeneous part.

from lffont.

8uos avatar 8uos commented on September 26, 2024

Hi, I guess that the error is caused by mismatching python/numpy version.
It can solved by adding dtype="object" to line 45 of datautils.py.
Modifying population = np.asarray(list(population)) to population = np.asarray(list(population), dtype="object) will help you.

from lffont.

KangyueXiong avatar KangyueXiong commented on September 26, 2024

I get the picture. Thank you

from lffont.

SanghyukChun avatar SanghyukChun commented on September 26, 2024

Closing the issue, assuming the answer resolves the problem.
Please re-open the issue as necessary.

from lffont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.