Fantasia3D icon indicating copy to clipboard operation
Fantasia3D copied to clipboard

WARNING: FAILED to save image out/Gundam/validate/mask/val_000000_mask.png

Open WakyWakyWayne opened this issue 9 months ago • 2 comments

print(result_dict) {'shaded': tensor([[[1.0000, 1.0000, 1.0000], [1.0000, 1.0000, 1.0000], [1.0000, 1.0000, 1.0000], ..., [1.0000, 1.0000, 1.0000], [1.0000, 1.0000, 1.0000], [1.0000, 1.0000, 1.0000]],

    [[1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     ...,
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000]],

    [[1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     ...,
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000]],

    ...,

    [[1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     ...,
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000]],

    [[1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     ...,
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000]],

    [[1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     ...,
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000],
     [1.0000, 1.0000, 1.0000]]], device='cuda:0'), 

mask': tensor([[[0.], [0.], [0.], ..., [0.], [0.], [0.]],

    [[0.],
     [0.],
     [0.],
     ...,
     [0.],
     [0.],
     [0.]],

    [[0.],
     [0.],
     [0.],
     ...,
     [0.],
     [0.],
     [0.]],

    ...,

    [[0.],
     [0.],
     [0.],
     ...,
     [0.],
     [0.],
     [0.]],

    [[0.],
     [0.],
     [0.],
     ...,
     [0.],
     [0.],
     [0.]],

    [[0.],
     [0.],
     [0.],
     ...,
     [0.],
     [0.],
     [0.]]], device='cuda:0'), 

'normal': tensor([[[1., 1., 1.], [1., 1., 1.], [1., 1., 1.], ..., [1., 1., 1.], [1., 1., 1.], [1., 1., 1.]],

    [[1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.],
     ...,
     [1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.]],

    [[1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.],
     ...,
     [1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.]],

    ...,

    [[1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.],
     ...,
     [1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.]],

    [[1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.],
     ...,
     [1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.]],

    [[1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.],
     ...,
     [1., 1., 1.],
     [1., 1., 1.],
     [1., 1., 1.]]], device='cuda:0')}

When def save_image(fn, x : np.ndarray): try: if os.path.splitext(fn)[1] == ".png":
imageio.imwrite(fn, np.clip(np.rint(x * 255.0), 0, 255).astype(np.uint8), compress_level=3) # Low compression for faster saving else: imageio.imwrite(fn, np.clip(np.rint(x * 255.0), 0, 255).astype(np.uint8)) except:

    print("WARNING: FAILED to save image %s" % fn)

I cant save mask.png. And the mask shape is (512,512,1), it looks no issue. normal and shaded PNG are OK,only mask failed.

WakyWakyWayne avatar Sep 13 '23 09:09 WakyWakyWayne