ProGamerGov / Neural-Zoom

Infinite Zoom For Style Transfer
MIT License
43 stars 8 forks source link

Can't start the script for some odd reason. #4

Open Testin1234 opened 4 years ago

Testin1234 commented 4 years ago

'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.

ProGamerGov commented 4 years ago

@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.

Testin1234 commented 4 years ago

@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 commented 4 years ago

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

ProGamerGov commented 4 years ago

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

Testin1234 commented 4 years ago

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'

ProGamerGov commented 4 years ago

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

Testin1234 commented 4 years ago

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 commented 4 years ago

Are my params wrong or something?

ProGamerGov commented 4 years ago

@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.

Testin1234 commented 4 years ago

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

kyeshmz commented 4 years ago

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.

ProGamerGov commented 4 years ago

@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!