lucid icon indicating copy to clipboard operation
lucid copied to clipboard

new style transfer error (just recently started happening)

Open 400lbhacker opened this issue 3 years ago • 5 comments

style transfer example requires content and style photo to be both same sized (800x,533) for example, and it requires they are in jpeg format with no transperency layer. following these rules, just recently the style transfer example no longe works. this is the error im receiving

Dimension 0 in both shapes must be equal, but are 800 and 533. Shapes are [800,533,3] and [533,800,3]. From merging shape 0 with other shapes. for 'stack_1' (op: 'Pack') with input shapes: [800,533,3], [533,800,3], [533,800,3].

400lbhacker avatar Apr 01 '21 21:04 400lbhacker

I'm having exactly the same problem. AND if you get the dimensions of content and style the same e.g., 1000 x 1000 px this error during the optimization: TypeError: inner() got an unexpected keyword argument 'difference_to' I think some depreciated tf code kicked in? There were warnings.

au5tr1ng3r avatar Apr 05 '21 13:04 au5tr1ng3r

found a temporary fix: launch a python 2.7 env using the following link below, than import the code into it and run, it than works https://colab.research.google.com/notebook#create=true&language=python2

here is my working example below based off my repository(https://github.com/400lbhacker/beast-pytorch-tensorflow-neural-style-transfer) https://colab.research.google.com/drive/1IgiqQ5dN5G2W2ntrNRtxOpeC1SY95GPn

400lbhacker avatar Apr 05 '21 14:04 400lbhacker

I have resolved this issue, I can patch any lucid project one is working on if you email me: [email protected], I cannot post to github due to the nature of the way colab is begging to default on py3 but i have a private repository that is pre configured that i can share as an example. I will update my beast neural style repository (based off lucid) with this snippet of info soon. have wonderful day ^-^

400lbhacker avatar Apr 07 '21 19:04 400lbhacker

Thanks mate! Works perfect.

au5tr1ng3r avatar Apr 10 '21 11:04 au5tr1ng3r

public fix for everyone to use is here I apologize for lateness: github: https://github.com/400lbhacker/Lucid-tensorflow-2d-neural-style-WORKING-FINAL colab: https://colab.research.google.com/github/400lbhacker/Lucid-tensorflow-2d-neural-style-WORKING-FINAL/blob/main/Final_Style.ipynb

400lbhacker avatar May 10 '21 16:05 400lbhacker