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

Is there any "neural_style.py" for TensorFlow 2.0? #93

Open
luisgo007 opened this issue Oct 3, 2019 · 6 comments
Open

Is there any "neural_style.py" for TensorFlow 2.0? #93

luisgo007 opened this issue Oct 3, 2019 · 6 comments

Comments

@luisgo007
Copy link

There is a script (tf_upgrade_v2 ) to convert "neural_style.py" from TensorFlow 1.X to TensorFlow 2.0 but the result script do not runs.

@dvschultz
Copy link

you should be able to just run this version in tf2.0. You’ll get some warnings but it works fine. at some point they may actually deprecate tf1 functions but for now it works fine.

@luisgo007
Copy link
Author

luisgo007 commented Oct 19, 2019 via email

@0merjavaid
Copy link

runs perfectly fine!!!

@THEAccess
Copy link

I get an exception when using the latest Tensorflow 2.x version. After downgrading via pip install tensorflow==1.15 everything works fine.

Exception:
Traceback (most recent call last): File "neural_style.py", line 858, in <module> main() File "neural_style.py", line 855, in main else: render_single_image() File "neural_style.py", line 824, in render_single_image stylize(content_img, style_imgs, init_img) File "neural_style.py", line 550, in stylize with tf.device(args.device), tf.Session() as sess: AttributeError: module 'tensorflow' has no attribute 'Session'

@siegmattel
Copy link

Yeah, it still doesn't run even after using the tf_upgrade_v2 script because of a fully deprecated function in there called contrib(). Unlike the rest of the deprecated functions that just have new syntax that can be easily swapped out, it has to be fixed on a case-by-case basis. I tried for a little bit, but I have zero experience with the TensorFlow framework, so I eventually gave up and just downgraded to tensorflow 1.15.

@PIPDesign
Copy link

Add "import tensorflow.compat.v1 as tf" to "neural_style.py"

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

6 participants