pmh47 / dirt

DIRT: a fast differentiable renderer for TensorFlow
MIT License
312 stars 63 forks source link

Setup error using colab #106

Open datased2019 opened 3 years ago

datased2019 commented 3 years ago

Just have a try using https://gist.github.com/pmh47/c91ad993c5676e604e3fcbe3c4599215, and always get error back. /content/dirt-repo/dirt/lighting.py in _get_face_normals(vertices, faces) 27 vertices_by_index = tf.transpose(vertices, [vertices_ndim - 2] + list(range(vertices_ndim - 2)) + [vertices_ndim - 1]) # indexed by vertex-index, , x/y/z 28 vertices_by_face = tf.gather(vertices_by_index, faces) # indexed by face-index, vertex-in-face, , x/y/z ---> 29 normals_by_face = tf.cross(vertices_by_face[:, 1] - vertices_by_face[:, 0], vertices_by_face[:, 2] - vertices_by_face[:, 0]) # indexed by face-index, *, x/y/z 30 normals_by_face /= (tf.norm(normals_by_face, axis=-1, keep_dims=True) + 1.e-12) # ditto 31 return normals_by_face, vertices_by_index

AttributeError: module 'tensorflow' has no attribute 'cross'

Any comments? Thx.