Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Testin1234 opened this issue Dec 3, 2019 · 12 comments
Open

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

Testin1234 opened this issue Dec 3, 2019 · 12 comments

Comments

@Testin1234
Copy link

'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
Copy link
Owner

ProGamerGov commented Dec 6, 2019

@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
Copy link
Author

@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
Copy link
Author

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

@ProGamerGov
Copy link
Owner

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

@Testin1234
Copy link
Author

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
Copy link
Owner

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

@Testin1234
Copy link
Author

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
Copy link
Author

Are my params wrong or something?

@ProGamerGov
Copy link
Owner

ProGamerGov commented Dec 13, 2019

@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
Copy link
Author

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

@kyeshmz
Copy link

kyeshmz commented Mar 10, 2020

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
Copy link
Owner

ProGamerGov commented Mar 11, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants