Protobuf-Dreamer icon indicating copy to clipboard operation
Protobuf-Dreamer copied to clipboard

indentation issues with python3

Open improvethings opened this issue 4 years ago • 6 comments

$ unzip -d model inception5h.zip Archive: inception5h.zip inflating: model/imagenet_comp_graph_label_strings.txt
inflating: model/tensorflow_inception_graph.pb
inflating: model/LICENSE
$ python pb_dreamer.py --input_image input.png File "pb_dreamer.py", line 120 g = calc_grad_tiled(img, t_grad, tile_size) ^ $ python -V Python 3.7.3

improvethings avatar Jan 18 '21 08:01 improvethings

You got any solution for this?

aertist avatar Jan 25 '21 03:01 aertist

I have no idea what is causing the error for the both of you, but you can submit a PR if you figure a fix!

Maybe there are a combination of tabs and spaces or something like that? But tabs + spaces would throw a different error I think.

ProGamerGov avatar Jan 27 '21 02:01 ProGamerGov

I have no idea what is causing the error for the both of you, but you can submit a PR if you figure a fix!

Maybe there are a combination of tabs and spaces or something like that? But tabs + spaces would throw a different error I think.

I made a colab notebook for this. Can you tell which python version you used for this code?

Is the neural-dream repo extended version of this? I saw a tiling feature in that too. Is there any difference between these two?

aertist avatar Jan 27 '21 04:01 aertist

I probably used Python2.7 as this project is really old. The neural-dream project is a completely different project completely designed by me and written in PyTorch. Protobuf-Dreamer is really old and likely very much out of date these days.

ProGamerGov avatar Jan 27 '21 15:01 ProGamerGov

Dude this is hella slow. 💀 But it is working now. You can add some lines in readme file like:

Environment Used Was:

  • Python==3.x
  • Tensorflow==1.x
  • scipy==1.2.0 (beacause imread is deprecated in the latest scipy versions)

Edit

Now its showing this error: Iteration Number: 0 Iteration Number: 1 Iteration Number: 2 Octave Number: 0 Iteration Number: 0 Iteration Number: 1 Iteration Number: 2 Octave Number: 1 Iteration Number: 0 Iteration Number: 1 Iteration Number: 2 Octave Number: 2 Traceback (most recent call last): File "pb_dreamer.py", line 152, in <module> imsave(output_name, output_img) File "/usr/local/lib/python3.6/dist-packages/skimage/io/_io.py", line 129, in imsave if arr.dtype == bool: AttributeError: 'Image' object has no attribute 'dtype'

You can click the same colab notebook to reproduce the error. Maybe this is because of the scipy version? Can you tell which scipy version you tested this with? 👀

I think this is a scikit-image issue

aertist avatar Jan 27 '21 16:01 aertist

Try replacing scipy with skimage like I used here: https://github.com/ProGamerGov/Neural-Tools/blob/master/linear-color-transfer.py

ProGamerGov avatar Jan 27 '21 16:01 ProGamerGov