Skip to content

Can not print to debug in the first field -> 'NoneType' object has no attribute 'data_type' #2973

Closed
@yihong0618

Description

@yihong0618

Describe the bug
Can not print to debug in the first field

To Reproduce

not work

import math

import taichi as ti

ti.init(arch=[ti.cuda, ti.metal])

dim = 3
N = 1024 * 8
dt = 2e-4
steps = 7
sun = ti.Vector([0.5, 0.5] if dim == 2 else [0.5, 0.5, 0.0])
gravity = 0.5
pressure = 0.3
tail_paticle_scale = 0.4
color_init = 0.3
color_decay = 1.6
vel_init = 0.07
res = 640

inv_m = ti.field(ti.f32)
color = ti.field(ti.f32)
x = ti.Vector.field(dim, ti.f32)
v = ti.Vector.field(dim, ti.f32)
print(v)
ti.root.bitmasked(ti.i, N).place(x, v, inv_m, color)
count = ti.field(ti.i32, ())
img = ti.field(ti.f32, (res, res))

work

import math

import taichi as ti

ti.init(arch=[ti.cuda, ti.metal])

dim = 3
N = 1024 * 8
dt = 2e-4
steps = 7
sun = ti.Vector([0.5, 0.5] if dim == 2 else [0.5, 0.5, 0.0])
gravity = 0.5
pressure = 0.3
tail_paticle_scale = 0.4
color_init = 0.3
color_decay = 1.6
vel_init = 0.07
res = 640

inv_m = ti.field(ti.f32)
color = ti.field(ti.f32)
x = ti.Vector.field(dim, ti.f32)
v = ti.Vector.field(dim, ti.f32)
ti.root.bitmasked(ti.i, N).place(x, v, inv_m, color)
count = ti.field(ti.i32, ())
img = ti.field(ti.f32, (res, res))
print(v)

Log/Screenshots
image


env

win10 python3.8.5

[Taichi] version 0.7.32, llvm 10.0.0, commit 6652f94f, win, python 3.8.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    potential bugSomething that looks like a bug but not yet confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions