ProGamerGov / neural-style-pt

PyTorch implementation of neural style transfer algorithm
MIT License
833 stars 178 forks source link

Sorry dumb question about running the script. #73

Closed Subash-Chandra closed 4 years ago

Subash-Chandra commented 4 years ago

How do I run the scripts through Conda? When I try to run it through Conda, it just keeps trying to open Bash and run it through that.

I edited the starry_stanford.sh script, and am trying to run it, someone help me out please.

ProGamerGov commented 4 years ago

I don't have a ton of experience with Conda, but does this help?

https://stackoverflow.com/questions/52779016/conda-command-working-in-command-prompt-but-not-in-bash-script

Subash-Chandra commented 4 years ago

That is for running conda commands in a bash script. I am asking for the reverse.

Are you able to run these scripts on Bash? Because I'm having errors like "Permission Denied" if I try "python starry_stanford.sh", and if I try to run "py starry_stanford.sh", it says the $PYTHON in Line 18 is Invalid Syntax.

ProGamerGov commented 4 years ago

@Subash-Chandra Oh, you are using the wrong interpreter then. You run .py scripts with the Python interpreter (python or python3), and you run bash scripts (files that end in .sh) with sh, bash, or ./ with no space between it and the script:

# How to run Python scripts
python neural_style.py
python3 neural_style.py

# How to run Bash scripts
sh starry_stanford.sh
bash starry_stanford.sh
./starry_stanford.sh

To correct permission issues with bash scripts, use:

chmod u+x starry_stanford.sh
Subash-Chandra commented 4 years ago

omg that makes sense. Thank you so much.

I'm still getting permission issues though...

image

Subash-Chandra commented 4 years ago

I've found the solution here. Darn Microsoft devs.

https://stackoverflow.com/questions/56974927/permission-denied-trying-to-run-python-on-windows-10