Fix tests

This commit is contained in:
Johannes Fischer
2021-07-26 16:35:45 +02:00
parent 69359b5af3
commit 5e89a83c88
4 changed files with 10 additions and 10 deletions

View File

@@ -11,11 +11,11 @@ filestr = 'tests/policies/base_'
def test_forward_pass():
batch = pickle.load(open(filestr + '_test_batch.pkl', 'rb'))
batch['relative_state'] = batch['relative_state'].float()
policy = BehaviorCloningPolicy.load_model(config, filestr)
policy.policy = policy.policy.type(batch['state'].dtype)
action = policy(batch)
i = torch.where(action.isnan())[0]
for key in batch.keys():
print(batch[key][i])
batch = pickle.load(open(filestr + '_test_batch.pkl', 'rb'))
batch['relative_state'] = batch['relative_state'].float()
policy = BehaviorCloningPolicy.load_model(config, filestr)
policy.policy = policy.policy.type(batch['state'].dtype)
action = policy(batch)
i = torch.where(action.isnan())[0]
for key in batch.keys():
print(batch[key][i])