set tf.device('/cpu:0') for render op explicitly
This commit is contained in:
Родитель
c6fd2eb1c5
Коммит
9121818a7b
|
@ -294,6 +294,7 @@ class Face3D():
|
|||
#using tf_mesh_renderer for rasterization (https://github.com/google/tf_mesh_renderer)
|
||||
# img: [batchsize,224,224,3] images in RGB order (0-255)
|
||||
# mask:[batchsize,224,224,1] transparency for img ({0,1} value)
|
||||
with tf.device('/cpu:0'):
|
||||
img_rgba = mesh_renderer.mesh_renderer(face_shape,
|
||||
tf.cast(facemodel.face_buf-1,tf.int32),
|
||||
face_norm,
|
||||
|
@ -318,6 +319,7 @@ class Face3D():
|
|||
|
||||
if is_train:
|
||||
# compute mask for small face region
|
||||
with tf.device('/cpu:0'):
|
||||
img_crop_rgba = mesh_renderer.mesh_renderer(mask_face_shape,
|
||||
tf.cast(facemodel.mask_face_buf-1,tf.int32),
|
||||
mask_face_norm,
|
||||
|
|
Загрузка…
Ссылка в новой задаче