-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
497e55d
commit 6c2203f
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
|
||
import numpy as np | ||
import torch | ||
from arguments import get_args | ||
from envs import make_vec_envs | ||
|
||
os.environ["OMP_NUM_THREADS"] = "1" | ||
|
||
args = get_args() | ||
args.agent = "zsos" # Doesn't really matter as long as it's not "sem_exp" | ||
args.split = "val" | ||
|
||
np.random.seed(args.seed) | ||
torch.manual_seed(args.seed) | ||
|
||
if args.cuda: | ||
torch.cuda.manual_seed(args.seed) | ||
|
||
|
||
def main(): | ||
num_episodes = int(args.num_eval_episodes) | ||
args.device = torch.device("cuda:0" if args.cuda else "cpu") | ||
|
||
torch.set_num_threads(1) | ||
envs = make_vec_envs(args) | ||
obs, infos = envs.reset() | ||
print(obs, infos) | ||
|
||
for ep_num in range(num_episodes): | ||
for step in range(args.max_episode_length): | ||
action = torch.randint(1, 3, (args.num_processes,)) | ||
obs, rew, done, infos = envs.step(action) | ||
print(obs.shape) | ||
print(obs.device) | ||
|
||
if done: | ||
break | ||
|
||
print("Test successfully completed") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ENVIRONMENT: | ||
MAX_EPISODE_STEPS: 500 | ||
SIMULATOR: | ||
TURN_ANGLE: 30 | ||
TILT_ANGLE: 30 | ||
ACTION_SPACE_CONFIG: "v1" | ||
AGENT_0: | ||
SENSORS: ['RGB_SENSOR', 'DEPTH_SENSOR', 'SEMANTIC_SENSOR'] | ||
HEIGHT: 0.88 | ||
RADIUS: 0.18 | ||
HABITAT_SIM_V0: | ||
GPU_DEVICE_ID: 0 | ||
ALLOW_SLIDING: True | ||
SEMANTIC_SENSOR: | ||
WIDTH: 640 | ||
HEIGHT: 480 | ||
HFOV: 79 | ||
POSITION: [0, 0.88, 0] | ||
RGB_SENSOR: | ||
WIDTH: 640 | ||
HEIGHT: 480 | ||
HFOV: 79 | ||
POSITION: [0, 0.88, 0] | ||
DEPTH_SENSOR: | ||
WIDTH: 640 | ||
HEIGHT: 480 | ||
HFOV: 79 | ||
MIN_DEPTH: 0.5 | ||
MAX_DEPTH: 5.0 | ||
POSITION: [0, 0.88, 0] | ||
TASK: | ||
TYPE: ObjectNav-v1 | ||
POSSIBLE_ACTIONS: ["STOP", "MOVE_FORWARD", "TURN_LEFT", "TURN_RIGHT", "LOOK_UP", "LOOK_DOWN"] | ||
SENSORS: ['GPS_SENSOR', 'COMPASS_SENSOR'] | ||
MEASUREMENTS: ['DISTANCE_TO_GOAL', 'SUCCESS', 'SPL'] | ||
SUCCESS: | ||
SUCCESS_DISTANCE: 0.2 | ||
|
||
DATASET: | ||
TYPE: PointNav-v1 | ||
SPLIT: train | ||
DATA_PATH: "data/datasets/objectnav/gibson/v1/{split}/{split}.json.gz" | ||
EPISODES_DIR: "data/datasets/objectnav/gibson/v1/{split}/" | ||
SCENES_DIR: "data/scene_datasets/" |