google-research / google-research/android_world
Error when get the reward in MiniWob task
- Dominant language
- Python
- Stars
- 906
- Forks
- 186
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 1
Description
**Situation**
When evaluating Mobile-miniwob tasks, I sometimes encounter the following error after executing certain actions.
**Error occured below**
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Action: {"action_type": "click", "index": 4}
Reason: The task is to create a line that bisects the angle evenly in two and then press the 'Submit' button. The instruction suggests that the bisector line is already created based on the screenshot. Therefore, the next logical step is to press the 'Submit' button to complete the task.
response time: 2.0694456100463867
Summary: Summary of this step: The 'Submit' button was clicked to finalize the task, assuming the bisector line creation was successful. The task is now complete.
Completed step 2.
SKIPPING MiniWobBisectAngle.
E0820 04:11:32.604304 33192 suite_utils.py:252] Logging exception and skipping task. Will keep running. Task: MiniWobBisectAngle: invalid literal for int() with base 10: '0.8680475871297262'
Traceback (most recent call last):
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\suite_utils.py", line 248, in _run_task
interaction_results, episode,complexity = run_episode(task)
^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\suite_utils.py", line 503, in run_episode
return episode_runner.run_episode(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\episode_runner.py", line 130, in run_episode
if termination_fn(agent.env):
^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\task_evals\miniwob\miniwob_base.py", line 64, in is_episode_terminated
return get_episode_reward(env.controller.env) != 0.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\task_evals\miniwob\miniwob_base.py", line 59, in get_episode_reward
return float(int(reward))
^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '0.8680475871297262'
Traceback (most recent call last):
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\suite_utils.py", line 248, in _run_task
interaction_results, episode,complexity = run_episode(task)
^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\suite_utils.py", line 503, in run_episode
return episode_runner.run_episode(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\episode_runner.py", line 130, in run_episode
if termination_fn(agent.env):
^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\task_evals\miniwob\miniwob_base.py", line 64, in is_episode_terminated
return get_episode_reward(env.controller.env) != 0.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\A_master\Ant_Agent\AndroidWorld_test\mobile_miniwob\android_world\task_evals\miniwob\miniwob_base.py", line 59, in get_episode_reward
return float(int(reward))
^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '0.8680475871297262'
```
**MY Thoughts**
I would like to implement a try-except mechanism that converts floating-point numbers with decimal points into standard decimal format when received. For example, 0.8680475871297262 would become .8680475871297262. Am I right?@crawles
Contributor guide
Assessment
This issue has not been assessed yet.