jharwell / sierra

Automation framework for the scientific method in AI research
MIT License
18 stars 1 forks source link

Example code #314

Closed Ritv1k closed 2 months ago

Ritv1k commented 5 months ago

I am trying to run the example code on Sierra right now. I got to step 6 and I keep getting this error.

"ritvik@ritvik-VirtualBox:~$ sierra-cli --sierra-root=$HOME/research/exp --template-input-file=exp/argos/template.argos --n-runs=4 --platform=platform.argos --project=argos_project --physics-n-engines=1 --controller=foraging.footbot_foraging --scenario=LowBlockCount.10x10x1 --batch-criteria population_size.Log8 --with-robot-leds --with-robot-rab --exp-overwrite 2024-05-18 12:23:13 INFO sierra.main - This is SIERRA 1.3.6. 2024-05-18 12:23:14 INFO sierra.main - Using python=3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]. 2024-05-18 12:23:14 INFO sierra.main - Loading plugins 2024-05-18 12:23:14 INFO sierra.main - Loading cmdline extensions from project 'argos_project' 2024-05-18 12:23:14 CRITICAL root - SIERRA has encountered an unexpected error and will now terminate.

traceback (most recent call last): File "/home/ritvik/.local/bin/sierra-cli", line 8, in sys.exit(main()) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 165, in main app = SIERRA(bootstrap) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 85, in init module = pm.module_load(path) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/plugin_manager.py", line 273, in module_load return import(name, fromlist=["*"]) ModuleNotFoundError: No module named 'argos_project'

"

jharwell commented 5 months ago

From that error message it looks like you don't have SIERRA_PLUGIN_PATH set correctly. What does echo $SIERRA_PLUGIN_PATH give, and where did you clone the sierra-sample-project repo to ?

Assuming you cloned sierra-sample-project to $HOME/research, SIERRA_PLUGIN_PATH should be set to $HOME/research/sierra-sample-project/projects. The argos_project module it is looking for is in that directory.

Ritv1k commented 5 months ago

image

Not sure what I am doing wrong....

Ritv1k commented 5 months ago

ritvik@ritvik-VirtualBox:~$ sierra-cli --sierra-root=$HOME/research/exp --template-input-file=exp/argos/template.argos --n-runs=4 --platform=platform.argos --project=argos_project --physics-n-engines=1 --controller=foraging.footbot_foraging --scenario=LowBlockCount.10x10x1 --batch-criteria population_size.Log8 --with-robot-leds --with-robot-rab --exp-overwrite 2024-05-19 11:13:27 INFO sierra.main - This is SIERRA 1.3.6. 2024-05-19 11:13:27 INFO sierra.main - Using python=3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]. 2024-05-19 11:13:27 INFO sierra.main - Loading plugins 2024-05-19 11:13:28 INFO sierra.main - Loading cmdline extensions from project 'argos_project' 2024-05-19 11:13:28 INFO argos_project.generators.scenario_generator_parser - Parse scenario generator from cmdline specification 'LowBlockCount.10x10x1' 2024-05-19 11:13:28 INFO sierra.main - Controller=foraging.footbot_foraging, Scenario=LowBlockCount.10x10x1 2024-05-19 11:13:28 INFO root - Generated batch root /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8 2024-05-19 11:13:28 INFO root - Create univariate batch criteria 'population_size.Log8' from 'variables.population_size' 2024-05-19 11:13:28 CRITICAL root - SIERRA has encountered an unexpected error and will now terminate.

If you think this is a bug, please report it at:

https://github.com/jharwell/sierra/issues

When reporting, please include as much information as you can. Ideally:

  1. What you were trying to do in SIERRA.
  2. The terminal output of sierra-cli, including the below traceback.
  3. The exact command you used to run SIERRA.

In some cases, creating a Minimum Working Example (MWE) reproducing the error with specific input files and/or data is also helpful for quick triage and fix.

Traceback (most recent call last): File "/home/ritvik/.local/bin/sierra-cli", line 8, in sys.exit(main()) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 166, in main app() File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 125, in call pipeline.run() File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/pipeline.py", line 145, in run PipelineStage1(self.cmdopts, File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage1/pipeline_stage1.py", line 35, in init self.generator = BatchExpDefGenerator(controller_name=controller, File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/generators/exp_generators.py", line 74, in init assert self.batch_config_template.is_file(), \ AssertionError: 'exp/argos/template.argos' is not a valid file

Getting a new error now

jharwell commented 5 months ago

That error is because you are running sierra from your home directory, and the path ~/exp/argos/templates.argos doesn't exist. Try running it from the sierra-example-project repo (this wasn't clear in the docs; will update).

As far as learning ARGoS, the best way is by looking at the examples: https://github.com/ilpincy/argos3-examples. For SIERRA, the best way is by reading the docs :-). I'm happy to help you with SIERRA as you have problems.

Ritv1k commented 5 months ago

ritvik@ritvik-VirtualBox:~/research/sierra-sample-project$ sierra-cli --sierra-root=$HOME/research/exp --template-input-file=exp/argos/template.argos --n-runs=4 --platform=platform.argos --project=argos_project --physics-n-engines=1 --controller=foraging.footbot_foraging --scenario=LowBlockCount.10x10x1 --batch-criteria population_size.Log8 --with-robot-leds --with-robot-rab --exp-overwrite 2024-05-21 09:46:55 INFO sierra.main - This is SIERRA 1.3.6. 2024-05-21 09:46:55 INFO sierra.main - Using python=3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]. 2024-05-21 09:46:55 INFO sierra.main - Loading plugins 2024-05-21 09:46:55 INFO sierra.main - Loading cmdline extensions from project 'argos_project' 2024-05-21 09:46:55 INFO argos_project.generators.scenario_generator_parser - Parse scenario generator from cmdline specification 'LowBlockCount.10x10x1' 2024-05-21 09:46:55 INFO sierra.main - Controller=foraging.footbot_foraging, Scenario=LowBlockCount.10x10x1 2024-05-21 09:46:55 INFO root - Generated batch root /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8 2024-05-21 09:46:55 INFO root - Create univariate batch criteria 'population_size.Log8' from 'variables.population_size' 2024-05-21 09:46:55 INFO sierra.core.pipeline.stage1.pipeline_stage1 - Generating input files for batch experiment in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8... 2024-05-21 09:46:55 INFO sierra.core.experiment.spec - Calculating scaffold: cli='population_size.Log8': Modify 1 XML tags per experiment 2024-05-21 09:46:55 WARNING sierra.core.experiment.definition - Node './/qt-opengl/user_functions' not found 2024-05-21 09:46:55 WARNING sierra.core.experiment.definition - Node './/qt-opengl/user_functions' not found 2024-05-21 09:46:55 WARNING sierra.core.experiment.definition - Node './/qt-opengl/user_functions' not found 2024-05-21 09:46:55 WARNING sierra.core.experiment.definition - Node './/qt-opengl/user_functions' not found 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage1.pipeline_stage1 - 16 input files generated in 4 experiments. 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Platform='platform.argos' exec_env='hpc.local' 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - batch_exp_root='/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8',runs/exp=4,threads/job=1,n_jobs=4 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Running exp0 in '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp0' 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd 'parallel --jobs 4 --results /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp0 --joblog /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp0/parallel.log --no-notice < "/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp0/commands.txt"' failed! 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stdout (last 10 lines): 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stderr (last 10 lines):

2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Check outputs in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp0 for full details 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Exp0 elapsed time: 0:00:00 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Running exp1 in '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp1' 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd 'parallel --jobs 4 --results /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp1 --joblog /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp1/parallel.log --no-notice < "/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp1/commands.txt"' failed! 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stdout (last 10 lines): 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stderr (last 10 lines):

2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Check outputs in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp1 for full details 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Exp1 elapsed time: 0:00:00 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Running exp2 in '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp2' 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd 'parallel --jobs 4 --results /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp2 --joblog /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp2/parallel.log --no-notice < "/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp2/commands.txt"' failed! 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stdout (last 10 lines): 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stderr (last 10 lines):

2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Check outputs in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp2 for full details 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Exp2 elapsed time: 0:00:00 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Running exp3 in '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp3' 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd 'parallel --jobs 4 --results /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp3 --joblog /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp3/parallel.log --no-notice < "/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp3/commands.txt"' failed! 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stdout (last 10 lines): 2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Cmd stderr (last 10 lines):

2024-05-21 09:46:56 ERROR sierra.core.pipeline.stage2.exp_runner - Check outputs in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp3 for full details 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.exp_runner - Exp3 elapsed time: 0:00:00 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage2.pipeline_stage2 - Execution complete in 0:00:00 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage3.pipeline_stage3 - Generating statistics from experiment outputs in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-outputs... 2024-05-21 09:46:56 INFO sierra.core.pipeline.stage3.statistics_calculator - Verifying results in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-outputs/exp0... 2024-05-21 09:46:56 CRITICAL root - SIERRA has encountered an unexpected error and will now terminate.

If you think this is a bug, please report it at:

https://github.com/jharwell/sierra/issues

When reporting, please include as much information as you can. Ideally:

  1. What you were trying to do in SIERRA.
  2. The terminal output of sierra-cli, including the below traceback.
  3. The exact command you used to run SIERRA.

In some cases, creating a Minimum Working Example (MWE) reproducing the error with specific input files and/or data is also helpful for quick triage and fix.

multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/statistics_calculator.py", line 153, in _gather_worker gatherer(exp_output_root) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/statistics_calculator.py", line 228, in call self._verify_exp_outputs(exp_output_root) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/statistics_calculator.py", line 346, in _verify_exp_outputs for exp1 in experiments: File "/usr/lib/python3.10/pathlib.py", line 1017, in iterdir for name in self._accessor.listdir(self): FileNotFoundError: [Errno 2] No such file or directory: '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-outputs/exp0' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/ritvik/.local/bin/sierra-cli", line 8, in sys.exit(main()) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 166, in main app() File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/main.py", line 125, in call pipeline.run() File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/pipeline.py", line 154, in run self.cmdopts).run(self.batch_criteria) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/pipeline_stage3.py", line 51, in run self._run_statistics(self.main_config, self.cmdopts, criteria) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/pipeline_stage3.py", line 82, in _run_statistics BatchExpParallelCalculator(main_config, cmdopts)(criteria) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/statistics_calculator.py", line 85, in call self._execute(exp_to_avg, avg_opts, n_gatherers, n_processors, pool) File "/home/ritvik/.local/lib/python3.10/site-packages/sierra/core/pipeline/stage3/statistics_calculator.py", line 125, in _execute g.get() File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get raise self._value FileNotFoundError: [Errno 2] No such file or directory: '/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-outputs/exp0' ritvik@ritvik-VirtualBox:~/research/sierra-sample-project$

Getting another error on step 6, not sure what to do.

jharwell commented 5 months ago

If you look in /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp0/parallel.log, what does it contain?

In addition, can you run e.g.

parallel --jobs 4 --results /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp3 --joblog /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/scratch/exp3/parallel.log --no-notice < "/home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/exp3/commands.txt"

in the terminal successfully?

Ritv1k commented 5 months ago

image

image

The two screenshots I have attached are for the contents of parallel.log and running the example in the terminal.

I really appreciate all the help. Thank you so much!

jharwell commented 5 months ago

Hmm it looks like ARGoS is exiting immediately with a code of 1. What do you get if you do argos3 --help in the terminal? Assuming that works, what happens if you do argos3 -c /home/ritvik/research/exp/argos_project/foragig.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/expr0/template_run0.argos in the terminal ?

Ritv1k commented 5 months ago

image image

These are the screenshots of me trying the lines of code.

jharwell commented 5 months ago

i had a typo in the file name: try argos3 -c /home/ritvik/research/exp/argos_project/foraging.footbot_foraging/template-LowBlockCount.10x10x1+population_size.Log8/exp-inputs/expr0/template_run0.argos (make sure there isn't another typo by cat .... first!)

Ritv1k commented 5 months ago

image

After making sure I had no typos, this is the error I got. "/usr/lib/argos3/libargos_project.so: /usr/lib/argos3/libargos_project.so: cannot open shared object file: No such file or directory"

jharwell commented 5 months ago

what's your ARGOS_PLUGIN_PATH set to?

Ritv1k commented 5 months ago

I set it to /usr. I tried setting it to different variations of /home/ritvik/Downloads/argos3_simulator-3.0.0-x86_64-beta59.deb but those did not work.

jharwell commented 5 months ago

ah--that's the issue. ARGOS_PLUGIN_PATH is similar to SIERRA_PLUGIN_PATH in that it needs to point to/contain the directory in which the controller+loop function libraries you are using can be found. For the sample project, that should be export ARGOS_PLUGIN_PATH=$HOME/research/sierra-sample-project/argos/build:/usr/local/lib/argos3, assuming ARGoS is installed to /usr/local. Also, make sure you have built the necessary ARGoS plugin libraries as detailed in the docs: https://sierra.readthedocs.io/en/master/src/trial.html

Ritv1k commented 4 months ago

image After checking ARGoS is not in /usr/local its in /usr/lib I tried using this as the path and it did not work.

jharwell commented 4 months ago

so what did you set your ARGOS_PLUGIN_PATH to, and what was the error you got (full output from ARGoS) when you tried to run?

jharwell commented 2 months ago

Closing as solved--please reopen if you continue to have issues!