Neural-Zoom icon indicating copy to clipboard operation
Neural-Zoom copied to clipboard

Can't start the script for some odd reason.

Open Testin1234 opened this issue 5 years ago • 12 comments

'python3' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "neural_zoom.py", line 229, in main() File "neural_zoom.py", line 112, in main first_run(run, params.output_image) File "neural_zoom.py", line 146, in first_run first_image = Image.open(params.output_dir + '/' + zeros(params.start_num, output)) File "C:\Apps\Anaconda\lib\site-packages\PIL\Image.py", line 2766, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'output_dir/out_0000.png' Using windows 10 of course.

Testin1234 avatar Dec 03 '19 19:12 Testin1234

@Testin1234 That's because on Windows 10, Python 3 is run with python and not python3. I never tested the script on Windows, but I believe you can resolve the issue by modifying this line: https://github.com/ProGamerGov/Neural-Zoom/blob/master/neural_zoom.py#L187

Change run = 'python3 ' to run = 'python ', and that should resolve the issue.

ProGamerGov avatar Dec 06 '19 03:12 ProGamerGov

@ProGamerGov It seems that it worked, but I am facing another issue. Capturing style target 1 Running optimization with L-BFGS Traceback (most recent call last): File "neural_style.py", line 468, in main() File "neural_style.py", line 262, in main optimizer.step(feval) File "C:\Apps\Anaconda\lib\site-packages\torch\optim\lbfgs.py", line 354, in step old_dirs.pop(0) IndexError: pop from empty list Traceback (most recent call last): File "neural_zoom.py", line 229, in main() File "neural_zoom.py", line 112, in main first_run(run, params.output_image) File "neural_zoom.py", line 146, in first_run first_image = Image.open(params.output_dir + '/' + zeros(params.start_num, output)) File "C:\Apps\Anaconda\lib\site-packages\PIL\Image.py", line 2766, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'output_dir/out_0000.png'

I'm not sure why it would do this. Do I need to re-specify the directory or something?

Testin1234 avatar Dec 06 '19 18:12 Testin1234

Actually, that doesnt seem to be the problem. Is it just unable to make the images?

Testin1234 avatar Dec 06 '19 18:12 Testin1234

Try creating a folder called output_dir, as the code expects that folder to exist (and tries to create it).

ProGamerGov avatar Dec 07 '19 03:12 ProGamerGov

Alright, did that and it still has the same error. Out of curiosity, I made a file in the output_dir called out_0000.png and it then had this issue: No such file or directory: 'output_dir/out_0001.png'

Testin1234 avatar Dec 07 '19 03:12 Testin1234

@Testin1234 What are the neural-zoom specific parameters that you are using?

ProGamerGov avatar Dec 08 '19 00:12 ProGamerGov

python neural_zoom.py -script neural_style.py -style_image Color.jpg -content_image tubingen.jpg -model_file models/models/vgg19-d01eb7cb.pth -num_frames 20 -starting_image tubingen.jpg

Testin1234 avatar Dec 09 '19 18:12 Testin1234

Are my params wrong or something?

Testin1234 avatar Dec 13 '19 22:12 Testin1234

@Testin1234 Sorry, for the late response, so far I've found the slash direction to be a potential error source, but the error message still remains. Your parameters are not the cause, as I can reproduce the error.

ProGamerGov avatar Dec 13 '19 22:12 ProGamerGov

Good to know that the error can be reproduced and I'm not messing it up. Hopefully this can be resolved soon.

Testin1234 avatar Dec 13 '19 23:12 Testin1234

Okay, so I moved a bit forward with this. Seems like the biggest problem here is with the tmp directories and how you are trying to keep the rendered version and a tmp dir. Also a problem with starting_num and the -1 arguements against it.

I can make a PR but just want some insight on what you originally wanted to do.

kyeshmz avatar Mar 10 '20 02:03 kyeshmz

@kkshmz It's been a long time since I created the code (and I was a lot worse at programming back back), but I seem to recall the one directory was for un-cropped images, and the other one was for cropped versions of the image. There is probably a better way to go about things though.

Feel free to submit a pull request!

ProGamerGov avatar Mar 11 '20 17:03 ProGamerGov