NVlabs / stylegan2-ada

StyleGAN2 with adaptive discriminator augmentation (ADA) - Official TensorFlow implementation
https://arxiv.org/abs/2006.06676
Other
1.8k stars 500 forks source link

Crashes on "Loading networks from" when run from subprocess module (cmd works fine) (WINDOWS! NOT LINUX) #81

Open FlashlightET opened 3 years ago

FlashlightET commented 3 years ago

im writing a discord bot and its supposed to be able to run the projector on an image but it doesnt even try to process. the subprocess output is simply

"b'\r\n(stylegan2) C:\\frart>python projector.py --outdir="c:\\frart\\out" --target="c:\\frart\\furrifyin.png" --network="c:\\frart\\furry.pkl" \r\nLoading networks from "c:\\frart\\furry.pkl"...\r\nPress any key to continue . . . \r\n'".

when run in command line it goes past it like so:

  np_resource = np.dtype([("resource", np.ubyte, 1)])
Loading networks from "c:\\frart\\furry.pkl"...
Setting up TensorFlow plugin "fused_bias_act.cu": Loading... Done.
Setting up TensorFlow plugin "upfirdn_2d.cu": Loading... Done.
Projector: Computing W midpoint and stddev using 10000 samples...
Projector: std = 16.2726
Projector: Setting up noise inputs...
Projector: Building image output graph...
Projector: Building loss graph...
Projector: Building noise regularization graph...
Projector: Setting up optimizer...
Projector: Preparing target images...
Projector: Initializing optimization state..

and continues like it should. i've implemented other conda environments (like esrgan) in just fine with the same code. the subprocess command is subprocess.check_output('conda activate stylegan2& funnybat.bat & pause', shell=True) funnybat consists of python projector.py --outdir="c:\frart\out" --target="c:\frart\furrifyin.png" --network="c:\frart\furry.pkl" funnybat exists because it didnt work directly either (but it works directly in cmd!) i've tried check_call and os.system too. furry.pkl is the "this fursona does not exist" model i've tried EVERYTHING i could POSSIBLY find on google, nothing is working. image please does ANYBODY know whats going on?!?! when i tried os.system i got this image and nobody has this issue other than me and only when i try it in a python script when it works every single other time