ttusar / coco

Numerical Black-Box Optimization Benchmarking Framework
http://coco.gforge.inria.fr/
Other
1 stars 1 forks source link

Working directory problem in Mario GAN #43

Closed ttusar closed 4 years ago

ttusar commented 4 years ago

When calling the example experiment in C on the rw-mario-gan suite, i get the following error:

RUN     ./example_experiment in code-experiments/build/c
python: can't open file 'D:\Delo\Github\ttusar-coco\pytorch\generator_ws.py': [Errno 2] No such file or directory
Exception in thread "main" java.lang.NullPointerException
        at cmatest.MarioEvalFunction.<init>(MarioEvalFunction.java:67)
        at coco.evaluateLevel.main(evaluateLevel.java:100)
Error within message evaluation: Command 'java -Djava.awt.headless=true -jar D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1.
Message = s rw-mario-gan t objectives r 1 f 11 i 1 d 10 x 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
Error: Command 'java -Djava.awt.headless=true -jar D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1.
Closing socket
Traceback (most recent call last):
  File "code-experiments\rw-problems\socket_server.py", line 174, in <module>
    socket_server_start(port=port, silent=silent)
  File "code-experiments\rw-problems\socket_server.py", line 153, in socket_server_start
    raise e
  File "code-experiments\rw-problems\socket_server.py", line 146, in socket_server_start
    response = evaluate_message(message)
  File "code-experiments\rw-problems\socket_server.py", line 100, in evaluate_message
    raise e
  File "code-experiments\rw-problems\socket_server.py", line 82, in evaluate_message
    values = evaluate_objectives(suite_name, func, instance, x)
  File "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan\mario_gan_evaluator.py", line 359, in evaluate_mario_gan
    out[i] = fun(x, netG, d)
  File "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan\mario_gan_evaluator.py", line 275, in basicFitnessSimAStar
    return executeSimulation(x, netG, dim, 1, 0)
ERROR: return value=1
  File "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan\mario_gan_evaluator.py", line 120, in executeSimulation
Running the example experiment... (might take time, be patient)
COCO INFO: Results will be output to folder exdata\RS_on_mario-gan

COCO INFO: 27.01.20 19:27:06, d=10, running: f10.f11.COCO FATAL ERROR: socket_communication_save_response(): Incorrect response -6.0000000000000000e+00 Â]·Ç˙ (size 0)
    java_output = subprocess.check_output('java -Djava.awt.headless=true -jar '+path+'/dist/MarioGAN.jar "' + str(x) +'" "' + netG + '" '+str(dim)+' '+str(fun)+' '+str(agent) +' ' +str(sim), shell=True);

  File "C:\Anaconda3\envs\py36coco\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "C:\Anaconda3\envs\py36coco\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'java -Djava.awt.headless=true -jar D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "D:\Delo\Github\ttusar-coco\code-experiments\rw-problems\mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1.

I think it is a working directory problem as I'm calling this from 'D:\Delo\Github\ttusar-coco\' and not 'D:\Delo\Github\ttusar-coco\rw-problems\mario_gan', so it does not find the file generator_ws.py

ttusar commented 4 years ago

@TheHedgeify

ttusar commented 4 years ago

With @TheHedgeify we found that the problem was caused by a mix of separators (the path had both '\' and '/').

ttusar commented 4 years ago

On Linux, the error message is as follows:

RUN ./example_experiment in code-experiments/build/c
python: can't open file '/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/pytorch/generator_ws.py': [Errno 2] No such file or directory
Exception in thread "main" java.lang.NullPointerException
    at cmatest.MarioEvalFunction.<init>(MarioEvalFunction.java:67)
    at coco.evaluateLevel.main(evaluateLevel.java:102)
Error within message evaluation: Command 'java -Djava.awt.headless=true -jar /home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1. 
Message = s rw-mario-gan t objectives r 1 f 11 i 1 d 10 x 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 
Error: Command 'java -Djava.awt.headless=true -jar /home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1.
ERROR: return value=1
Running the example experiment... (might take time, be patient)
COCO INFO: Results will be output to folder exdata/RS_on_mario-gan-004

COCO INFO: 24.04.20 01:21:32, d=10, running: f01.f11.COCO FATAL ERROR: socket_communication_save_response(): Incorrect response  (size 0)

Closing socket
Traceback (most recent call last):
  File "code-experiments/rw-problems/socket_server.py", line 174, in <module>
    socket_server_start(port=port, silent=silent)
  File "code-experiments/rw-problems/socket_server.py", line 153, in socket_server_start
    raise e
  File "code-experiments/rw-problems/socket_server.py", line 146, in socket_server_start
    response = evaluate_message(message)
  File "code-experiments/rw-problems/socket_server.py", line 100, in evaluate_message
    raise e
  File "code-experiments/rw-problems/socket_server.py", line 82, in evaluate_message
    values = evaluate_objectives(suite_name, func, instance, x)
  File "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/mario_gan_evaluator.py", line 359, in evaluate_mario_gan
    out[i] = fun(x, netG, d)
  File "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/mario_gan_evaluator.py", line 275, in basicFitnessSimAStar
    return executeSimulation(x, netG, dim, 1, 0)
  File "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/mario_gan_evaluator.py", line 120, in executeSimulation
    java_output = subprocess.check_output('java -Djava.awt.headless=true -jar '+path+'/dist/MarioGAN.jar "' + str(x) +'" "' + netG + '" '+str(dim)+' '+str(fun)+' '+str(agent) +' ' +str(sim), shell=True);
  File "/home/tea/miniconda3/envs/py36coco/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/home/tea/miniconda3/envs/py36coco/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'java -Djava.awt.headless=true -jar /home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/dist/MarioGAN.jar "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" "/home/tea/Documents/ttusar-coco/code-experiments/rw-problems/mario_gan/GAN/overworld-10-5000/netG_epoch_4999_5641.pth" 10 1 0 1' returned non-zero exit status 1.
ttusar commented 4 years ago

Fixed by the latest commit by @TheHedgeify