pix2pixHD icon indicating copy to clipboard operation
pix2pixHD copied to clipboard

'Tensor' object has no attribute 'uint8'

Open tx871217 opened this issue 3 years ago • 3 comments

Hi,

I was running the "test.py' with python test.py --name xxx --netG local --resize_or_crop none --data_type 8 --dataroot './datasets/xxxx' --loadSize 256 --fineSize 256 --label_nc 0 --no_instance --ngf 32 and got error AttributeError: 'Tensor' object has no attribute 'uint8' at line 45 Was this because the Pytorch version? Mine is 1.9.0 Help me solve this, plzzz~

tx871217 avatar Jul 12 '21 11:07 tx871217

The same for torch 1.9 After change *.uint8() to *.to(torch.uint8), this part passed. However face another error: image

flyingmrwang avatar Aug 03 '21 08:08 flyingmrwang

after wrapping export with torch.no_grad(), previous one passed.. While here comes another one: image

flyingmrwang avatar Aug 03 '21 10:08 flyingmrwang

Hi, did someone solve it?

MikhailKulyabin avatar Oct 26 '21 16:10 MikhailKulyabin