cc
cc copied to clipboard
viz3 = np.vstack((255*tgt_img_viz, 255*depth_viz, 255*mask_viz... in test_mask
Hello, there seems something wrong with "vstack". The codes reports error as follows:
viz3_im = Image.fromarray(viz3.astype('uint8')) TypeError: Cannot handle this data type
Can you help me with this, thanks!
you should change 'viz3.astype('uint8')
' to 'viz3.transpose(1, 2, 0).astype('uint8')
', due to the format should be [h, w, 3], not [3, h, w].
you should change '
viz3.astype('uint8')
' to 'viz3.transpose(1, 2, 0).astype('uint8')
', due to the format should be [h, w, 3], not [3, h, w].
Through this, I also got the issue about typeerror and the black flow images. Do you know the reason? Thanks a lot.
You need to make sure of the following. Maybe the conventions have changed with pytorch versions.
- If you are using the correct dim order HWC or CHW.
- If you in the correct range, there is a multiplication by 255 which assumes that the expected range should be 0-255. However if conventions have changed to 0-1 then avoid this multiplication.