Lornatang / UGATIT-PyTorch

Simple, fast and easy to read. Yes, we use the pytorch framework!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facing this error RuntimeError: output with shape [1, 96, 96] doesn't match the broadcast shape [3, 96, 96]

muruga86 opened this issue · comments

I tried to run your code on a ubuntu 20.4.3 os but get the below error like broadcast image or clock related.
Could you give me a work around or fix for this issue?

$ python3 test_image.py --file assets/testA_2.jpg --model-name selfie2anime --image-size 96 --cuda
Namespace(cuda=True, file='assets/testA_2.jpg', image_size=96, manualSeed=None, model_name='selfie2anime')
Random Seed: 4871
Traceback (most recent call last):
File "test_image.py", line 70, in
image = pre_process(image).unsqueeze(0)
File "/home/murugan86/.local/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 67, in call
img = t(img)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in call_impl
result = self.forward(*input, **kwargs)
File "/home/murugan86/.local/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 226, in forward
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/home/murugan86/.local/lib/python3.8/site-packages/torchvision/transforms/functional.py", line 284, in normalize
tensor.sub
(mean).div_(std)
RuntimeError: output with shape [1, 96, 96] doesn't match the broadcast shape [3, 96, 96]

$python3 test_image.py --file assets/testA_1.jpg --model-name selfie2anime --image-size 96 --cuda
Namespace(cuda=True, file='assets/testA_1.jpg', image_size=96, manualSeed=None, model_name='selfie2anime')
Random Seed: 9013
Traceback (most recent call last):
File "test_image.py", line 73, in
start = time.clock()
AttributeError: module 'time' has no attribute 'clock'

$python3 test_image.py --file assets/testA_3.jpg --model-name selfie2anime --image-size 96 --cuda
Namespace(cuda=True, file='assets/testA_3.jpg', image_size=96, manualSeed=None, model_name='selfie2anime')
Random Seed: 1868
Traceback (most recent call last):
File "test_image.py", line 73, in
start = time.clock()
AttributeError: module 'time' has no attribute 'clock'

$ python3 test.py --dataset selfie2anime --image-size 96 --cuda
Namespace(cuda=True, dataroot='./data', dataset='selfie2anime', image_size=96, manualSeed=None, outf='./results')
Random Seed: 1628
0it [00:00, ?it/s]