Install this library with Python 3.7 and PyTorch 1.7.1
Run the test python3 -m pytest tests/algorithms
Observed Results
You get the errors
FAILED tests/algorithms/test_algorithms.py::test_pets_icem_gaussian_mlp_ensemble - TypeError: clamp(): argument 'min' (position 2) must be Number, not Tensor
FAILED tests/algorithms/test_algorithms.py::test_pets_icem_basic_ensemble_deterministic_mlp - TypeError: clamp(): argument 'min' (position 2) must be Number, not Tensor
because torch.clamp doesn't support tensors for the min and max arguments till version 1.9.0. So either the README should be updated with the newer PyTorch version or the test/code should be fixed to work with 1.7.0 still.
Expected Results
Tests pass successfully.
Relevant Code
The error occurs at
population = mbrl.util.math.powerlaw_psd_gaussian(
self.colored_noise_exponent,
size=(decay_population_size, x0.shape[1], x0.shape[0]),
device=self.device,
).transpose(1, 2)
population = torch.clamp(
population * torch.sqrt(var) + mu, self.lower_bound, self.upper_bound
)
E TypeError: clamp(): argument 'min' (position 2) must be Number, not Tensor
mbrl/planning/trajectory_opt.py:439: TypeError
Steps to reproduce
python3 -m pytest tests/algorithms
Observed Results
You get the errors
because
torch.clamp
doesn't support tensors for the min and max arguments till version1.9.0
. So either the README should be updated with the newer PyTorch version or the test/code should be fixed to work with1.7.0
still.Expected Results
Tests pass successfully.
Relevant Code
The error occurs at