google-research / android_world

AndroidWorld is an environment and benchmark for autonomous agents
Apache License 2.0
145 stars 14 forks source link

How to save the snapshot of the avd #165

Open cjfcsjt opened 3 weeks ago

cjfcsjt commented 3 weeks ago

Running env_launcher.load_and_setup_env() with emulator_setup=True requires a few minutes. Is it possible to run the setup and then save the snapshot of the avd?

crawles commented 3 weeks ago

Yes, it’s definitely possible. Do you know where your AVD snapshot is located on your MacBook? On macOS, it's typically in ~/.android/avd/. You should be able to save this and reload it

Working on a more permanent solution.

cjfcsjt commented 2 weeks ago

Thanks for reply! I have an additional question:

When attempting a specific task multiple times (e.g., 10 times) with the following config:

suite = suite_utils.create_suite(
      task_registry.get_registry(family=_SUITE_FAMILY.value),
      n_task_combinations=10, # n_task_combinations,
      seed=2025, # _TASK_RANDOM_SEED.value,
      tasks=['AudioRecorderRecordAudioWithFileName'],
      use_identical_params=True, # _FIXED_TASK_SEED.value,
)

I noticed that the environment changes unexpectedly, for example, Record-1 becomes 1Record-1, with an extra 1 added. bug_in_aw

How can I resolve this issue?

crawles commented 2 weeks ago

You can set this flag equal to true https://github.com/google-research/android_world/blob/653a02986f62d8676061510261eb1629fde95dd6/run.py#L133

The reason the task changes is because the random seed changes

Chris

On Mon, Nov 18, 2024 at 1:36 AM JingfanChen @.***> wrote:

Thanks for reply! I have an additional question:

When attempting a specific task multiple times (e.g., 10 times) with the following config:

suite = suite_utils.create_suite( task_registry.get_registry(family=_SUITE_FAMILY.value), n_task_combinations=10, # n_task_combinations, seed=2025, # _TASK_RANDOM_SEED.value, tasks=['AudioRecorderRecordAudioWithFileName'], use_identical_params=True, # _FIXED_TASK_SEED.value, )

I noticed that the environment changes unexpectedly, for example, Record-1 becomes 1Record-1, with an extra 1 added. bug_in_aw.png (view on web) https://github.com/user-attachments/assets/3b14828d-2345-484b-8c28-58bfd2e73a14

How can I resolve this issue?

— Reply to this email directly, view it on GitHub https://github.com/google-research/android_world/issues/165#issuecomment-2482074843, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG26SIJZZ23ROD4QQV7KV32BGDG5AVCNFSM6AAAAABRNUP37OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBSGA3TIOBUGM . You are receiving this because you commented.Message ID: @.***>

cjfcsjt commented 2 weeks ago

I set the use_identical_params = True in the suite_utils.create_suite() function. Besides, as I understand it, this Record-1 is not caused by the randomness of the task. Record-1 is the default name given to the audio by this app. The task requires changing the default name to a specified one. I noticed that this default naming can change as long as I repeat this task multiple times, up to n_task_combinations.

crawles commented 2 weeks ago

Ah, sorry I didn't look closely enough at your code :)

I've figured out the bug and it will be fixed by https://github.com/google-research/android_world/pull/185. Thanks for reporting!