MineDojo / Voyager

An Open-Ended Embodied Agent with Large Language Models
https://voyager.minedojo.org/
MIT License
5.4k stars 493 forks source link

list index out of range #61

Closed ItsBean closed 11 months ago

ItsBean commented 1 year ago

I use gpt3.5 to test the model ,and how can i solve this problem

Traceback (most recent call last): File "/home/xxxx/bean/Voyager/voyager/voyager.py", line 331, in learn messages, reward, done, info = self.rollout( File "/home/xxxx/bean/Voyager/voyager/voyager.py", line 289, in rollout messages, reward, done, info = self.step() File "/home/xxxx/bean/Voyager/voyager/voyager.py", line 262, in step self.recorder.record([], self.task) File "/home/xxxx/bean/Voyager/voyager/utils/record_utils.py", line 35, in record events[0][1]["status"]["position"]["x"], IndexError: list index out of range Mineflayer process has exited, restarting Subprocess mineflayer started with PID 32288. /home/xxxx/bean/Voyager/voyager/env/process_monitor.py:65: UserWarning: Subprocess mineflayer failed to start. warnings.warn(f"Subprocess {self.name} failed to start.") start post, info are: http://localhost:3000 {'port': 39731, 'reset': 'hard', 'inventory': {}, 'equipment': [None, None, None, None, None, None], 'spread': False, 'waitTicks': 20, 'position': {'x': -15.5, 'y': 80, 'z': -15.5}} 600 Your last round rollout terminated due to error: list index out of range Failed to complete task Mine 1 wood log. Skipping to next task. Completed tasks:

xieleo5 commented 1 year ago

Hi, seems that the mineflayer process crashed before it runs the generated code. Can you share your mineflayer log here?

GoingMyWay commented 1 year ago

Same issue. The following is the log

2023-06-19 18:46:10,980 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:46:11,981 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:46:12,572 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:46:12,572 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:46:12,589 - mineflayer - INFO - {
2023-06-19 18:46:12,590 - mineflayer - INFO - port: 25565,
2023-06-19 18:46:12,590 - mineflayer - INFO - reset: 'hard',
2023-06-19 18:46:12,590 - mineflayer - INFO - inventory: {},
2023-06-19 18:46:12,590 - mineflayer - INFO - equipment: [],
2023-06-19 18:46:12,590 - mineflayer - INFO - spread: false,
2023-06-19 18:46:12,590 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:46:12,590 - mineflayer - INFO - position: null
2023-06-19 18:46:12,590 - mineflayer - INFO - }
2023-06-19 18:46:22,468 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:46:23,478 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:46:24,045 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:46:24,045 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:46:24,062 - mineflayer - INFO - {
2023-06-19 18:46:24,062 - mineflayer - INFO - port: 25565,
2023-06-19 18:46:24,062 - mineflayer - INFO - reset: 'soft',
2023-06-19 18:46:24,062 - mineflayer - INFO - inventory: {},
2023-06-19 18:46:24,062 - mineflayer - INFO - equipment: [],
2023-06-19 18:46:24,062 - mineflayer - INFO - spread: false,
2023-06-19 18:46:24,062 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:46:24,062 - mineflayer - INFO - position: null
2023-06-19 18:46:24,062 - mineflayer - INFO - }
2023-06-19 18:46:49,948 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:46:50,957 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:46:51,546 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:46:51,547 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:46:51,563 - mineflayer - INFO - {
2023-06-19 18:46:51,564 - mineflayer - INFO - port: 25565,
2023-06-19 18:46:51,564 - mineflayer - INFO - reset: 'hard',
2023-06-19 18:46:51,564 - mineflayer - INFO - inventory: {},
2023-06-19 18:46:51,564 - mineflayer - INFO - equipment: [ null, null, null, null, null, null ],
2023-06-19 18:46:51,564 - mineflayer - INFO - spread: false,
2023-06-19 18:46:51,564 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:46:51,564 - mineflayer - INFO - position: { x: -367.5, y: 67, z: -351.5 }
2023-06-19 18:46:51,564 - mineflayer - INFO - }
2023-06-19 18:46:55,266 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:46:56,276 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:46:56,845 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:46:56,845 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:46:56,861 - mineflayer - INFO - {
2023-06-19 18:46:56,861 - mineflayer - INFO - port: 25565,
2023-06-19 18:46:56,861 - mineflayer - INFO - reset: 'soft',
2023-06-19 18:46:56,861 - mineflayer - INFO - inventory: {},
2023-06-19 18:46:56,861 - mineflayer - INFO - equipment: [],
2023-06-19 18:46:56,861 - mineflayer - INFO - spread: false,
2023-06-19 18:46:56,861 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:46:56,862 - mineflayer - INFO - position: null
2023-06-19 18:46:56,862 - mineflayer - INFO - }
2023-06-19 18:47:29,601 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:47:30,610 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:47:31,190 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:47:31,191 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:47:31,207 - mineflayer - INFO - {
2023-06-19 18:47:31,207 - mineflayer - INFO - port: 25565,
2023-06-19 18:47:31,207 - mineflayer - INFO - reset: 'hard',
2023-06-19 18:47:31,207 - mineflayer - INFO - inventory: {},
2023-06-19 18:47:31,208 - mineflayer - INFO - equipment: [ null, null, null, null, null, null ],
2023-06-19 18:47:31,208 - mineflayer - INFO - spread: false,
2023-06-19 18:47:31,208 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:47:31,208 - mineflayer - INFO - position: { x: -351.5, y: 64.33152379758701, z: -383.5 }
2023-06-19 18:47:31,208 - mineflayer - INFO - }
2023-06-19 18:47:34,927 - mineflayer - INFO - Stopping subprocess.
2023-06-19 18:47:35,938 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/home/Me/minecraft_work/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-06-19 18:47:36,510 - mineflayer - INFO - Server started on port 3000
2023-06-19 18:47:36,510 - mineflayer - INFO - Subprocess is ready.
2023-06-19 18:47:36,527 - mineflayer - INFO - {
2023-06-19 18:47:36,527 - mineflayer - INFO - port: 25565,
2023-06-19 18:47:36,527 - mineflayer - INFO - reset: 'soft',
2023-06-19 18:47:36,527 - mineflayer - INFO - inventory: {},
2023-06-19 18:47:36,527 - mineflayer - INFO - equipment: [],
2023-06-19 18:47:36,527 - mineflayer - INFO - spread: false,
2023-06-19 18:47:36,527 - mineflayer - INFO - waitTicks: 20,
2023-06-19 18:47:36,527 - mineflayer - INFO - position: null
2023-06-19 18:47:36,527 - mineflayer - INFO - }
GoingMyWay commented 1 year ago

After debugging for a while, I found the errors could be raised by the parsing function process_ai_message. So, if there is something wrong in the generated function, the list index out of range may happen.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

uglyghost commented 9 months ago

To resolve the "IndexError: list index out of range" issue, consider updating to Python 3.10. Note that Python 3.8 does not enforce type annotations for functions and variables.

Raven-July commented 6 months ago

having the same issue. no matter how long i wait,it just keeps telling me "IndexError: list index out of range" wonders so much how to fix this issue