virtualhome: Problem for demo/generate_snapshot.py

demo/generate_snapshot.py was failed in my environment. Source code is current master branch and my environments were listed below.

OS: ubuntu18.04 unity_simulator: linux_exec.v2.2.4.x86_64

On the other hand, generate_video.py works well.

Here are error messages for generate_snapshot.py Timeout may occur at comm.expand_scene…

virtualhome/demo# python3 generate_snapshot.py
python3 generate_snapshot.py
Inferring preconditions...
[{'is_off': ['television', '1']}, {'plugged': ['television', '1']}, {'atreach': [['controller', '1'], ['sofa', '1']]}, {'free': ['sofa', '1']}]
Loading graph
Executing script
['[Walk] <television> (1)', '[SwitchOn] <television> (1)', '[Walk] <sofa> (1)', '[Find] <controller> (1)', '[Grab] <controller> (1)']
Generating snapshots
  0% 0/6 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1373, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 311, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 272, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 306, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../simulation/unity_simulator/comm_unity.py", line 92, in post_command
    resp = requests.post(self._address, json=request_dict, timeout=self.timeout_wait)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "generate_snapshot.py", line 74, in <module>
    messages, images = obtain_snapshots(graph_state_list, graph_input, comm)
  File "generate_snapshot.py", line 43, in obtain_snapshots
    message = comm.expand_scene(graph_state, randomize=True, random_seed=seed)
  File "../simulation/unity_simulator/comm_unity.py", line 322, in expand_scene
    'stringParams': string_params})
  File "../simulation/unity_simulator/comm_unity.py", line 98, in post_command
    raise UnityCommunicationException(str(e))
unity_simulator.comm_unity.UnityCommunicationException: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=30)

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Hi @kswain98 ! I tested on the latest version, and find that the problems also occurred when there is “add_character()” before “expand_scene()”.

        comm.reset(0)
        comm.add_character()
        message = comm.expand_scene(graph_state, randomize=False, random_seed=seed)

Same Error with 2.3.0, Ubuntu 18.0.4