minosworld / minos

MINOS: Multimodal Indoor Simulator
MIT License
201 stars 33 forks source link

RoomSimulator tries to load incorrect resource. #149

Open mcimpoi opened 5 years ago

mcimpoi commented 5 years ago

Hi, I am trying to debug the evaluation code for UNREAL agent (https://github.com/minosworld/unreal), which doesn't seem to work with the latest MINOS master branch (Updated after #135 )

I tried to isolate the problem, that is, ran the following snippet, which copies the same behavior from evaluate.py (create environment, which is creating a room simulator):

 args = sim_args.parse_sim_args(parser)
 args.visualize_sensors = True
 env_args = {'episode_schedule': 'test',
                'log_action_trace': True,
                'max_states_per_scene': 10,
                'episodes_per_scene_test': 1}
args.update(env_args)
sim = RoomSimulator(args) 
obs_space = sim.get_observation_space(args['outputs']) # hangs ---- infinite loop waiting for sim.start(), in new_episode.

And looking in the logs (simserver.log):

2019-01-17 18:50:25,269 INFO b'Seeding simulator rng with 86717763'
2019-01-17 18:50:25,274 INFO b'starting memory= { rss: 210280448,'
2019-01-17 18:50:25,274 INFO b'  heapTotal: 127823872,'
2019-01-17 18:50:25,274 INFO b'  heapUsed: 89676272,'
2019-01-17 18:50:25,275 INFO b'  external: 1412720 }'
2019-01-17 18:50:25,276 INFO b'preloadData { loadSceneStatistics: false, loadSounds: false }'
2019-01-17 18:50:25,283 INFO b'Loading scene  mp3d.gxdoqLR6rwA'
2019-01-17 18:50:25,284 INFO b'preloading /work//mp3d/scans/gxdoqLR6rwA/house_segmentations/gxdoqLR6rwA.house using HouseLoader'
2019-01-17 18:50:25,284 ERROR b"Error preloading objectInstanceMaterials for asset mp3d.gxdoqLR6rwA /work//mp3d/scans/gxdoqLR6rwA/instances_mesh/3f6062eeed474a6691e1116032b09fc7.mtl { [Error: ENOENT: no such file or directory, open '/work//mp3d/scans/gxdoqLR6rwA/instances_mesh/3f6062eeed474a6691e1116032b09fc7.mtl']"
2019-01-17 18:50:25,289 INFO b'preloading /work//mp3d/navgrid_10/gxdoqLR6rwA/gxdoqLR6rwA.furnished.grid.json'
2019-01-17 18:50:25,289 ERROR b'  errno: -2,'
2019-01-17 18:50:25,289 INFO b'preloading /work//mp3d/scans/gxdoqLR6rwA/instances_mesh/3f6062eeed474a6691e1116032b09fc7.mtl using MTLLoaderWrapper'
2019-01-17 18:50:25,290 ERROR b"  code: 'ENOENT',"
2019-01-17 18:50:25,290 ERROR b"  syscall: 'open',"
2019-01-17 18:50:25,290 ERROR b'  path:'
2019-01-17 18:50:25,290 ERROR b"   '/work//mp3d/scans/gxdoqLR6rwA/instances_mesh/3f6062eeed474a6691e1116032b09fc7.mtl' }"
2019-01-17 18:50:25,350 ERROR b'Object not associated with a region { index: 14,'
2019-01-17 18:50:25,350 ERROR b'  parentIndex: -1,'
2019-01-17 18:50:25,350 ERROR b'  categoryIndex: 3,'
2019-01-17 18:50:25,350 ERROR b'  obb:'
2019-01-17 18:50:25,350 ERROR b'   OBB {'
2019-01-17 18:50:25,350 ERROR b'     position: Vector3 { x: 0.562502, y: 45.3538, z: 1.40307 },'
2019-01-17 18:50:25,350 ERROR b'     halfSizes: Vector3 { x: 21.2669, y: 4.85036, z: 0.530069 },'
2019-01-17 18:50:25,350 ERROR b'     basis: Matrix4 { elements: [Float32Array] } },'
2019-01-17 18:50:25,350 ERROR b'  segments: [] }'
2019-01-17 18:50:25,418 INFO b'Removing subscribers for event drain [ 0 ]'

Surprisingly, the following snippet works without problems:

args = sim_args.parse_sim_args(parser)
args.visualize_sensors = True
sim = Simulator(args) # dumped args to a json file and compared them, for both RoomSimulator and 
# Simulator -- no differences, except for port and aparently nothing else relevant
common.attach_exit_handler(sim)

sim.init()
curr_schedule = 'test'
ep_schedulers = common.create_episode_schedulers(args)
test_ep_scheduler = ep_schedulers['test']
test_ep_scheduler.reset()
ep_settings = test_ep_scheduler.next_episode()

config = dict()
config['scene'] = {'fullId': args['scene']['dataset'] + '.' + ep_settings['scene_id'],
                   'level': ep_settings['level'],
                   'textureSet': curr_schedule}
config['goal'] = {'type': 'position', 'position': ep_settings['goal']['position']}
config['start'] = ep_settings['start']

sim.init()
sim.seed(0)
sim.configure(config)
ep_info = sim.start()

Any hints on how to solve it? Many thanks in advance!