cysmith / neural-style-tf

TensorFlow (Python API) implementation of Neural Style
GNU General Public License v3.0
3.11k stars 828 forks source link

Not supported with tensorflow 2+ #107

Open peterslany opened 4 years ago

peterslany commented 4 years ago

It would be useful to put into readme that this repo works only with TensorFlow version below 2.0, because the contrib attribute is no longer supported in later versions.

dalmo1991 commented 4 years ago

Probably it would be good practice specify versions for all requirements. Thanks

ssg-git commented 3 years ago

Any advice on how to downgrade? Getting stuck on going to 1.15

nickyvdz-art commented 3 years ago

It would be useful to put into readme that this repo works only with TensorFlow version below 2.0, because the contrib attribute is no longer supported in later versions.

Probably it would be good practice specify versions for all requirements. Thanks

maybe ive missed something - but: Implementation Details

All images were rendered on a machine with:

CPU: Intel Core i7-6800K @ 3.40GHz × 12
GPU: NVIDIA GeForce GTX 1080/PCIe/SSE2
OS: Linux Ubuntu 16.04.1 LTS 64-bit
CUDA: 8.0
python: 2.7.12
tensorflow: 0.10.0rc
opencv: 2.4.9.1
CherylHuang commented 3 years ago

I did a little change on the code then run on tf 2.3.1 and it works fine. First I simply change neural_style.py into neural_style_v2.py by using tf_upgrade_v2 (reference here) Then delete all of the ".value" (e.g. h.value, w.value ...) Finally use the adam opt instead of lbfgs As @peterslany said the contrib attribute is no longer supported in tf 2+ versions, but I think maybe it could be replaced with the opt here? If you think the result of using the adam opt isn't good enough. (I haven't tried it)

the env I'm using:

python=3.7.9
tensorflow=2.3.1
opencv=4.5.2
CUDA=10.0
cuDNN=7.6.5

Hope this helps!

scyheidekamp commented 3 years ago

I did a little change on the code then run on tf 2.3.1 and it works fine. First I simply change neural_style.py into neural_style_v2.py by using tf_upgrade_v2 (reference here) Then delete all of the ".value" (e.g. h.value, w.value ...) Finally use the adam opt instead of lbfgs As @peterslany said the contrib attribute is no longer supported in tf 2+ versions, but I think maybe it could be replaced with the opt here? If you think the result of using the adam opt isn't good enough. (I haven't tried it)

the env I'm using:

python=3.7.9
tensorflow=2.3.1
opencv=4.5.2
CUDA=10.0
cuDNN=7.6.5

Hope this helps!

Hey, would you mind sharing your version somewhere? I'm trying to make this work, it would help me a lot!

BDinspel commented 3 years ago

I did a little change on the code then run on tf 2.3.1 and it works fine. First I simply change neural_style.py into neural_style_v2.py by using tf_upgrade_v2 (reference here) Then delete all of the ".value" (e.g. h.value, w.value ...) Finally use the adam opt instead of lbfgs As @peterslany said the contrib attribute is no longer supported in tf 2+ versions, but I think maybe it could be replaced with the opt here? If you think the result of using the adam opt isn't good enough. (I haven't tried it) the env I'm using:

python=3.7.9
tensorflow=2.3.1
opencv=4.5.2
CUDA=10.0
cuDNN=7.6.5

Hope this helps!

Hey, would you mind sharing your version somewhere? I'm trying to make this work, it would help me a lot! neural_style.txt

I attached my version as .txt. It worked for me, maybe it'll help someone else, too

sbetzin commented 2 years ago

@BDinspel Do you have forked this with the whole update? Do you mind sharing it?

strohrbaugh commented 8 months ago

@BDinspel Thanks so much for this! You saved me a lot of effort. Works great.

I attached my version as .txt. It worked for me, maybe it'll help someone else, too