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

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

Open
yangyichu opened this issue Sep 7, 2021 · 3 comments
Open

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

yangyichu opened this issue Sep 7, 2021 · 3 comments

Comments

@yangyichu
Copy link

yangyichu commented Sep 7, 2021

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.

@erizmr
Copy link
Collaborator

erizmr commented Oct 26, 2021

Hi, @yangyichu , the errors should be sorted after the latest updates, please check the updated "diffmpm.py" :)

@ZiXuanVickyLu
Copy link

I am using taichi 0.8.9. yet I find those errors in my code, either. I can not fix it...It is very strange as (I think) I'm following the example from the offical docs, but it just reports this error, anyway...

@erizmr
Copy link
Collaborator

erizmr commented Jan 11, 2022

Hi @birepeople , would you mind posting your code so that we can help debug?

BTW, it is also recommended to post any Taichi related questions on this forum:
https://forum.taichi.graphics/

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

3 participants