当前位置:网站首页>When pycharm debugs, view the tensor image of pytorch in the console

When pycharm debugs, view the tensor image of pytorch in the console

2022-04-23 21:57:00 Three stone orders

Stop at the breakpoint , Enter relevant instructions on the console ;

# debug At the time console View in tensor Images 
image_tensor = target.cpu()
image_array = image_tensor.numpy()
from PIL import Image
image_PIL = Image.fromarray(image_array.astype('uint8'))
image_PIL.save("/home/wang/home/wang/aa.jpg")

版权声明
本文为[Three stone orders]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204200615437195.html