Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow implementation #33

Open
zsdonghao opened this issue Aug 23, 2018 · 6 comments
Open

TensorFlow implementation #33

zsdonghao opened this issue Aug 23, 2018 · 6 comments

Comments

@zsdonghao
Copy link

Hi Xunhuang,

We like your paper very much, and reimplement it in TensorFlow here:
https://github.com/tensorlayer/tensorlayer/tree/master/example/adaptive_style_transfer

We hope more people can benefit from this work.

Best wishes,

@ArturoDeza
Copy link

Amazing results and implementation @zsdonghao ! In what version of tensorflow did you compile it on? I'm having some issues running your off the shelf implementation.

@zsdonghao
Copy link
Author

Hi, it is run on master version of TensorLayer on github and latest version of TensorFlow.

@ArturoDeza
Copy link

ArturoDeza commented Aug 23, 2018

I've ran this on terminal, maybe I'm passing the variables the wrong way (I'm used to passing variable arguments like this in lua)?
I have tensorflow v 1.8.0, and the latest tensorflayer install from pip install

$ python test.py -content_input content_1.png -style_input style_1.png

and got this error:

arturo@machine:/media/arturo/AlphaStorage/Arturo/tensorlayer/tensorlayer-master/example/adaptive_style_transfer$ python test.py -content_input content_1.png 
-style_input style_1.png
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-08-23 11:58:08.819534: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-08-23 11:58:09.202401: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: 
name: GeForce GTX TITAN X major: 5 minor: 2 memoryClockRate(GHz): 1.076
pciBusID: 0000:03:00.0
totalMemory: 11.93GiB freeMemory: 11.81GiB
2018-08-23 11:58:09.202431: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0
2018-08-23 11:58:09.446657: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-08-23 11:58:09.446687: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929]      0 
2018-08-23 11:58:09.446692: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0:   N 
2018-08-23 11:58:09.446954: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 11437 MB memory) -> physical GPU (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:03:00.0, compute capability: 5.2)
build Encoder model finished:
build Encoder model finished:
Traceback (most recent call last):
  File "test.py", line 47, in <module>
    dec_net = decoder.decode(target_features, prefix="decoder/")
  File "/media/arturo/AlphaStorage/Arturo/tensorlayer/tensorlayer-master/example/adaptive_style_transfer/models.py", line 39, in decode
    net = UpSampling2dLayer(net, [2, 2], method=1)
  File "/usr/local/lib/python2.7/dist-packages/tensorlayer/decorators/deprecated_alias.py", line 24, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorlayer/layers/image_resampling.py", line 70, in __init__
    size_h = size[0] * int(self.inputs.get_shape()[1])
TypeError: __int__ returned non-int (type NoneType)

@zsdonghao
Copy link
Author

@ArturoDeza the master version of tensorlayer should be installed via git clone

@SmitSheth
Copy link

@zsdonghao
Copy link
Author

@SmitSheth it is moved out to a individual repo : https://github.com/tensorlayer/adaptive-style-transfer

btw, we release the master version as 1.10.1, so the pip install version should work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants