LouieYang / deep-photo-styletransfer-tf

Tensorflow (Python API) implementation of Deep Photo Style Transfer
805 stars 186 forks source link

Smooth local affine / TypeError #8

Closed Otherend1 closed 7 years ago

Otherend1 commented 7 years ago

Hello,

I've had troubles to launch the transfer with smooth local affine, the main problem was that when it was passing a float in the grid parameter I had this error :

block=(256, 1, 1), grid=((h * w) / 256 + 1, 1)
  File "/home/username/local/miniconda/lib/python3.6/site-packages/pycuda/driver.py", line 402, in function_call
    func._launch_kernel(grid, block, arg_buf, shared, None)
TypeError: No registered converter was able to produce a C++ rvalue of type unsigned int from this Python object of type float

Which can be easily fixed by transtyping the grid parameter : grid=(int((h * w) / 256 + 1), 1)

Tell me if you had this problem and if it's the right fix, Otherend1

LouieYang commented 7 years ago

Yes, I think it's the right fix to the different division pattern between python2 and python3