sunshineatnoon/PytorchWCT

CPU running problem

Closed this issue · 1 comments

cryer commented

I run "python WCT.py" on ubuntu,because I donot have GPU,but an error just happened

Transferring in4.jpg
Traceback (most recent call last):
File "WCT.py", line 109, in
styleTransfer(cImg, sImg, imname, csF)
File "WCT.py", line 56, in styleTransfer
csF5 = wct.transform(cF5, sF5, csF, args.alpha)
File "/home/kurumi233/projects/PytorchWCT-master/util.py", line 86, in transform
targetFeature = self.whiten_and_color(cFView, sFView)
File "/home/kurumi233/projects/PytorchWCT-master/util.py", line 44, in whiten_and_color
c_mean = c_mean.unsqueeze(1).expand_as(cF)
File "/home/kurumi233/anaconda3/lib/python3.6/site-packages/torch/tensor.py", line 215, in expand_as
return self.expand(tensor.size())
RuntimeError: the number of sizes provided must be greater or equal to the number of dimensions in the tensor at /opt/conda/conda-bld/pytorch_1501971235237/work/pytorch-0.1.12/torch/lib/TH/generic/THTensor.c:290

PS:I have deleted all .cuda() yet.I know maybe this is not the fault of CPU,I just want to know how to solve this problem.

I created a pull request with this fix in it. for the moment, you can check out my version until it's integrated into the mainline.

Just get it from here:
https://github.com/ccrome/PytorchWCT