Skip to content

how to fix field(s) are not placed error #46

@yangyichu

Description

@yangyichu

So I'm trying to run the examples yet many of the examples throw the error as shown below:(diffmpm as an example)
File "diffmpm.py", line 386, in
main()
File "diffmpm.py", line 348, in main
weights[i, j] = np.random.randn() * 0.01
...
RuntimeError: These field(s) are not placed:
File "diffmpm.py", line 32, in
actuator_id = ti.field(ti.i32)
File "diffmpm.py", line 33, in
particle_type = ti.field(ti.i32)
...............many similar errors...................
File "diffmpm.py", line 44, in
x_avg = vec()

So I tried to fix these errors by assigning a shape manually (ti.Vector.field(...shape=(xx,xx))), yet some shapes are not very clear to me and takes a lot of work, is there any decent fix of these?

I tried on windows and ubuntu18.04, both have similar issue, my taichi version is 0.7.31.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions