anishathalye / neural-style

Neural style in TensorFlow! 🎨
https://anishathalye.com/an-ai-that-can-mimic-any-artist/
GNU General Public License v3.0
5.54k stars 1.52k forks source link

Attribute error #170

Closed arbolis closed 3 years ago

arbolis commented 3 years ago

I am running the shoorano branch of this repository (https://github.com/shoorano/neural-style), which is essentially 1 commit ahead and fixes some compatibility issues with the latest tensorflow. Here is the tail of the terminal's output:

Iteration 1000/1000 (6 min 6 sec elapsed, 0 sec remaining)
content loss: 1.72563e+06
  style loss: 1.44583e+08
     tv loss: nan
  total loss: nan
Traceback (most recent call last):
  File "neural_style.py", line 292, in <module>
    main()
  File "neural_style.py", line 219, in main
    for iteration, image, loss_vals in stylize(
  File "/home/isaac/Documents/art_github_2/neural-style/stylize.py", line 207, in stylize
    img_out = vgg.unprocess(best.reshape(shape[1:]), vgg_mean_pixel)
AttributeError: 'NoneType' object has no attribute 'reshape'
anishathalye commented 3 years ago

Does that error occur with the version of the code in this repo, when run against TensorFlow 1.x?

arbolis commented 3 years ago

Unfortunately I haven't been able to install such an old version of TensorFlow, yet. So, as I don't have much time for that anymore, I just wanted this problem to be known, just in case it mattered to be fixed.

400lbhacker commented 3 years ago

!git clone https://github.com/anishathalye/neural-style !wget https://www.vlfeat.org/matconvnet/models/imagenet-vgg-verydeep-19.mat pip install scipy==1.1.0 %tensorflow_version 1.x !python /content/neural-style/neural_style.py --help

anishathalye commented 3 years ago

Closing due to age