cysmith / neural-style-tf

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

AttributeError: 'module' object has no attribute 'total_variation' #38

Closed gregpaulos closed 7 years ago

gregpaulos commented 7 years ago

Attempting to run on floydhub. Uploaded the vgg weights as a dataset file on floydhub.

Using the floyd-cli, ran in my terminal: floyd run --gpu --env tensorflow-0.12:py2 --data datasets/vggforstyle/1:vgg "python neural_style.py --content_img golden_gate.jpg --style_imgs starry-night.jpg --original_colors --model_weights /vgg/imagenet-vgg-verydeep-19.mat --img_output_dir /output --verbose;"

And get the following error in the log: 2017-09-13 13:56:16,853 INFO - Traceback (most recent call last): 2017-09-13 13:56:16,855 INFO - File "neural_style.py", line 856, in 2017-09-13 13:56:16,856 INFO - main() 2017-09-13 13:56:16,856 INFO - File "neural_style.py", line 853, in main 2017-09-13 13:56:16,856 INFO - else: render_single_image() 2017-09-13 13:56:16,856 INFO - File "neural_style.py", line 822, in render_single_image 2017-09-13 13:56:16,856 INFO - stylize(content_img, style_imgs, init_img) 2017-09-13 13:56:16,856 INFO - File "neural_style.py", line 562, in stylize 2017-09-13 13:56:16,856 INFO - L_tv = tf.image.total_variation(net['input']) 2017-09-13 13:56:16,857 INFO - AttributeError: 'module' object has no attribute 'total_variation'

Any suggestions?

Thanks!

cysmith commented 7 years ago

Update your TensorFlow to the most recent version.

gregpaulos commented 7 years ago

Awesome - totally worked - thanks for the lightning-quick response!

(And duh on me for the rookie mistake)

lcb931023 commented 6 years ago

The readme's "Implementation Details" section still lists this project as tested with tensorflow (0.10.0rc). Let's update it so that more people will have an easier time setting it up :)

Leif-US commented 1 year ago

Seems to be working with 1.0.0. Newer versions don't work because of incompatibility with Python 2