Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fix CI #65

Merged
merged 6 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/unittest/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@


python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch_geometric
python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torch_geometric

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall

pip install torchrl

cd ../BenchMARL
Expand Down
4 changes: 3 additions & 1 deletion .github/unittest/install_dependencies_nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch_geometric

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall
python -m pip install torch
# Not using nightly torch
# python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall

cd ..
python -m pip install git+https://github.com/pytorch-labs/tensordict.git
Expand Down
10 changes: 2 additions & 8 deletions benchmarl/algorithms/isac.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
ProbabilisticActor,
TanhNormal,
)
from torchrl.objectives import (
ClipPPOLoss,
DiscreteSACLoss,
LossModule,
SACLoss,
ValueEstimators,
)
from torchrl.objectives import DiscreteSACLoss, LossModule, SACLoss, ValueEstimators

from benchmarl.algorithms.common import Algorithm, AlgorithmConfig
from benchmarl.models.common import ModelConfig
Expand Down Expand Up @@ -149,7 +143,7 @@ def _get_loss(
)
return loss_module, True

def _get_parameters(self, group: str, loss: ClipPPOLoss) -> Dict[str, Iterable]:
def _get_parameters(self, group: str, loss: LossModule) -> Dict[str, Iterable]:
items = {
"loss_actor": list(loss.actor_network_params.flatten_keys().values()),
"loss_qvalue": list(loss.qvalue_network_params.flatten_keys().values()),
Expand Down
2 changes: 1 addition & 1 deletion benchmarl/algorithms/maddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def get_value_module(self, group: str) -> TensorDictModule:
modules.append(
TensorDictModule(
lambda state, action: torch.cat(
[state, action.view(*action.shape[:-2], -1)], dim=-1
[state, action.reshape(*action.shape[:-2], -1)], dim=-1
),
in_keys=["state", (group, "action")],
out_keys=["state_action"],
Expand Down
2 changes: 1 addition & 1 deletion benchmarl/algorithms/masac.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_continuous_value_module(self, group: str) -> TensorDictModule:
modules.append(
TensorDictModule(
lambda state, action: torch.cat(
[state, action.view(*action.shape[:-2], -1)], dim=-1
[state, action.reshape(*action.shape[:-2], -1)], dim=-1
),
in_keys=["state", (group, "action")],
out_keys=["state_action"],
Expand Down
2 changes: 1 addition & 1 deletion test/test_vmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_reloading_trainer(
algo_config = algo_config.get_from_yaml()
if isinstance(algo_config, VdnConfig):
# There are some bugs currently in TorchRL https://github.com/pytorch/rl/issues/1593
return
pytest.skip()
ExperimentUtils.check_experiment_loading(
algo_config=algo_config,
model_config=mlp_sequence_config,
Expand Down
Loading