titu1994 / Neural-Style-Transfer

Keras Implementation of Neural Style Transfer from the paper "A Neural Algorithm of Artistic Style" (http://arxiv.org/abs/1508.06576) in Keras 2.0+
Apache License 2.0
2.26k stars 481 forks source link

Invalid float #29

Closed Ratinod closed 7 years ago

Ratinod commented 7 years ago

1) Run Programm 2) Programm say "XXX not in standard format" 3) Сhange all "." to "," 4) ??? 5) python say "invalid float value" proofpics

Fix it please.

titu1994 commented 7 years ago

Well that's a new bug. Must be a localisation bug ? Are you in a country which uses ',' instead of '.' to demark decimal point ?

I'm currently under a ton of course load. If you can find a fix, please make a pull request at https://github.com/titu1994/Neural-Style-Transfer-Windows

Ratinod commented 7 years ago

Yes. It's localisation bug.

"...please make a pull request..."

I'm sorry, but I have no idea how to do it. But I found working (probably only for me) solution.

Need add this:

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

before all Convert.ToDouble

"all" mean:

CheckTVWeignt()
CheckStyleScale()
CheckMinThreshold()
CheckContentWeignt()

in MainForm.cs

But, even after that, again, there are errors. And I don't know how to fix it, and what's the problem ... Here are screenshots of errors. Need some help. Again.

titu1994 commented 7 years ago

That error has been corrected in an earlier commit. You can download the repo again or copy paste the most recent code to get that working.

I'll be using your fix after testing that it doesn't break anything else in a few days.

Ratinod commented 7 years ago

"...download the repo again..."

And then there was a new "bug"... Screenshot An endless stream of errors... What's wrong now? How to fix it? P.S. I'm tired of trying to catch each time disappearing ( in an instant) window with error.

titu1994 commented 7 years ago

Are you using Theano in GPU mode? Because your errors suggest that you are using the CPU. This code is not meant for CPU execution, since it takes thousands of seconds per iteration on even the most powerful CPUs.

This is an error with linking BLAS libraries on CPU mode.

To setup Theano on GPU, use the Guide.md on the repo page. It has full instructions to setup Theano with GPU on windows.

As a side note, in order to see the error screen properly, there is a second button called "Copy to Clipboard" which copies the arguments.

Then travel to the place where the program is, go to the script directory, open a cmd with Shift + right click at that location and type python network.py (with the space) and then paste (right click and paste, or ctrl V if on windows 10).

Then the error screen will stay on the screen.

Ratinod commented 7 years ago

At last I was able to get it to work properly! My problem was that I didn't see anywhere mention in "README.md" about "Guide.md" until you say me that. It turned out that it is necessary to use the Anaconda 3 (I had Anaconda 2). And instead of "Visual Studio 2015" need to use "Visual Studio 2013". Ideally, you want someone to make a complete video tutorial that shows virtually all the steps for windows. But not me. I had enough. It should be mentioned in README.md about Guide.md . (Really. It is important information.) Screenshots with my test. Now I'm going to learn how to achieve interesting results by changing settings.

Thank you very much for your help!

And I apologize for the grammatical errors in the comments. (If they exist in the text)[because google translate]

titu1994 commented 7 years ago

Umm, the second paragraph in the Readme.md is titled Guide with the first sentence pointing to the guide.md. Anyway. I guess I should make it more explicit.