askforalfred / alfred

ALFRED - A Benchmark for Interpreting Grounded Instructions for Everyday Tasks
MIT License
352 stars 77 forks source link

Stuck in controller.step() #130

Closed wzcai99 closed 1 year ago

wzcai99 commented 1 year ago

I follow the installation instructions and trying to run check_thor.py, but I was stuck when calling c.step(),

python ./scripts/check_thor.py
thor-201909061227-Linux64: [|||||||||||||||||||||||||||||||||||||||||||||||||||||||| 100%   1.7 MiB/s]  of 390.MB
Found path: /home/henry/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64
Mono path[0] = '/home/henry/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64_Data/Managed'
Mono config path = '/home/henry/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64_Data/Mono/etc'
Preloaded 'ScreenSelector.so'
Display 0 '0': 1024x768 (primary device).
Logging to /home/henry/.config/unity3d/Allen Institute for Artificial Intelligence/AI2-Thor/Player.log

When I look into the log file, I got one error:

CAMERA DEPTH TEXTURE SET TO: Depth

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

SocketException: The socket has been shut down
  at System.Net.Sockets.Socket.Send (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at AgentManager+<EmitFrame>c__Iterator3.MoveNext () [0x00000] in <filename unknown>:0
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <>

(Filename:  Line: -1)

Could you give me some suggestions on this problem? Thank you.

MohitShridhar commented 1 year ago

@wzcai99, I am not sure what is happening here. Maybe try reinstalling like here: https://github.com/allenai/ai2thor/issues/1105

Also try asking on ai2thor/issues: https://github.com/allenai/ai2thor/issues

wzcai99 commented 1 year ago

@MohitShridhar I found using another version of ai2thor fix this problem, but is the alfred code, e.g the class ThorEnv compatible with another version of ai2thor?

gautierdag commented 1 year ago

@wzcai99 what version of ai2thor fixed this for you?

I've haven't been able to fix the SocketException.

wzcai99 commented 1 year ago

@gautierdag I still use the ai2thor version 2.1.0, and I fixed the error by replacing the version of two packages werkzeug and flask. Try this pip instal werkzeug==2.03 flask==2.0.3

gautierdag commented 1 year ago

You can't understand how long I've spent trying to fix this. I was persuaded it was an error with my Xorg setup. Thank you!

Wang1665941855 commented 1 year ago

@gautierdag Can you tell me your Xorg setup? Thank you.

gautierdag commented 1 year ago

@Wang1665941855 I've got it working using the startx.py script following the README.

Though note that startx.py requires root permissions - which you can't always have. A good alternative I've found to work is to use xvfb which is often installed on clusters and remote environments.

For instance:

xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' python scripts/check_thor.py

EDIT: I pushed the fix to the requirements.txt and put it in PR #138

Wang1665941855 commented 1 year ago

@gautierdag Thank you for your reply. I use my laptop to connect to the server to run the code. When I execute startx.py and then run check_thor.py, and then a dialog box in aithor2 will pop up, displaying a picture, but the program will continue to execute unless you manually stop the code. That is, I can't normally run check_thor.py, is this the problem with Xorg setup? Can you help me? Thank you very much. My server system is Linux Ubuntu.

gautierdag commented 1 year ago

@Wang1665941855 it could be a lot of things. Have you checked the Player log? Does it have any errors like the above socket issue? Does the startx script give you any errors?

If you don't get the socket error above you might want to create a new GitHub issue and describe your problem in more details.

jiadingfang commented 1 year ago

Same error running check_thor.py, and the above solution updating werkzeug and flask does not help as I'm running locally so there is no socket problem. However, this is what I got

(alfred) fjd:~/alfred$ python scripts/check_thor.py Found path: /home/fjd/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64 Mono path[0] = '/home/fjd/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64_Data/Managed' Mono config path = '/home/fjd/.ai2thor/releases/thor-201909061227-Linux64/thor-201909061227-Linux64_Data/Mono/etc' Preloaded 'ScreenSelector.so' Display 0 'DELL U2422H 24"': 1920x1080 (primary device). Logging to /home/fjd/.config/unity3d/Allen Institute for Artificial Intelligence/AI2-Thor/Player.log ^CTraceback (most recent call last): File "scripts/check_thor.py", line 5, in event = c.step(dict(action="MoveAhead")) File "/home/fjd/miniconda3/envs/alfred/lib/python3.8/site-packages/ai2thor/controller.py", line 654, in step self.last_event = queue_get(self.request_queue) File "/home/fjd/miniconda3/envs/alfred/lib/python3.8/site-packages/ai2thor/server.py", line 41, in queue_get res = que.get(block=True, timeout=0.5) File "/home/fjd/miniconda3/envs/alfred/lib/python3.8/queue.py", line 179, in get self.not_empty.wait(remaining) File "/home/fjd/miniconda3/envs/alfred/lib/python3.8/threading.py", line 306, in wait gotit = waiter.acquire(True, timeout) KeyboardInterrupt

As of today, the pytorch version 1.1.0 is not available, so when installing ALFRED, I remove all version numbers in requirements.txt except ai2thor==2.1.0 because it is said to be critical for ALFRED.