Skip to content

Commit

Permalink
Yet another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoOinonen committed Jan 30, 2024
1 parent 410dc73 commit 99ad4d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mlspm/data_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def _collate_batch(batch: Iterable[dict]):

# Switch the batch and channel dimension around
Xs = list(np.stack(Xs, axis=0).transpose(1, 0, 2, 3, 4))
if len(Ys) > 0:
if len(Ys) > 0 and len(Ys[0]) > 0:
Ys = list(np.stack(Ys, axis=0).transpose(1, 0, 2, 3))
sws = list(np.stack(sws, axis=0).transpose(1, 0, 2, 3))

Expand Down
2 changes: 1 addition & 1 deletion mlspm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _get_distributed() -> Tuple[int, int, int, Optional[dist.ProcessGroup]]:
world_size = dist.get_world_size()
local_rank = global_rank = dist.get_rank()
group = dist.group.WORLD
except (RuntimeError, AssertionError):
except (RuntimeError, AssertionError, ValueError):
world_size = 1
group = None
if world_size <= 1:
Expand Down

0 comments on commit 99ad4d1

Please sign in to comment.