allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.17k stars 217 forks source link

Calling controller reset was hung #268

Closed hcv1027 closed 5 years ago

hcv1027 commented 5 years ago

I just modify the example code from the document with different scene. I found that there are lots of scene will just hang, never load successfully. (More than 10 minutes). In success case, it just takes no more than 3 seconds.
For example, controller.reset('FloorPlan478') takes more than 17 minutes, and still locked at this line , but controller.reset('FloorPlan206') will complete immediately. Here is my code:

import ai2thor.controller
import cv2
import numpy as np
import random

controller = ai2thor.controller.Controller()
controller.start()

# Kitchens: FloorPlan1 - FloorPlan30
# Living rooms: FloorPlan201 - FloorPlan230
# Bedrooms: FloorPlan301 - FloorPlan330
# Bathrooms: FloorPLan401 - FloorPlan430
scene_name = 'FloorPlan' + str(random.randint(1, 530))
print("scene name: {}".format(scene_name))
controller.reset(scene_name)
print('initialize')
controller.step(
    dict(action='Initialize', gridSize=0.25, renderDepthImage=True))
event = controller.step(dict(action='MoveAhead'))
img = event.depth_frame
img = img / 5000 * 255
cv2.imshow('img', img.astype(np.uint8))
cv2.waitKey(0)

My hardward is Lenovo T460

CPU: Intel® Core™ i7-6700HQ CPU @ 2.60GHz × 8
Memory: 16 G
GPU: GeForce 940MX
OS: Ubuntu 16.04, 64 bit

I run the code in docker. Any idea of how to fix this?

roozbehm commented 5 years ago

There is no FloorPlan478. The maximum FloorPlan number is 430. Can you send us another scene number that hangs?

hcv1027 commented 5 years ago

Hi @roozbehm FloorPlan113 will hang too. Actually, almost all will hang in my environment.

roozbehm commented 5 years ago

There is no FloorPlan113 either. Please refer to the range in the code you copy pasted above (the comments). You are choosing a random number between 1 and 530. Most of those numbers are not in the range.

hcv1027 commented 5 years ago

Hi @roozbehm, I'm sorry. It's my careless, I did not notice that the number is not continuous. Thanks for your reply.