Skip to content

Conversation

@creativequotient
Copy link

Due to the possibility of x[1] being of type torch.Tensor, the np.mean(...) call fails with an AttributeError: torch.dtype object has no attribute type.

The full error is

[ERROR 03:50:05] pymarl Failed after 0:01:46! Traceback (most recent calls WITHOUT Sacred internals): File "src/main.py", line 35, in my_main run(_run, config, _log) File "/home/minerva/Projects/multiagentrl/pymarl/src/run.py", line 48, in run run_sequential(args=args, logger=logger) File "/home/minerva/Projects/multiagentrl/pymarl/src/run.py", line 209, in run_sequential logger.print_recent_stats() File "/home/minerva/Projects/multiagentrl/pymarl/src/utils/logging.py", line 48, in print_recent_stats item = "{:.4f}".format(np.mean([x[1] for x in self.stats[k][-window:]])) File "<__array_function__ internals>", line 6, in mean File "/home/minerva/anaconda3/envs/mpe/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 3335, in mean out=out, **kwargs) File "/home/minerva/anaconda3/envs/mpe/lib/python3.6/site-packages/numpy/core/_methods.py", line 161, in _mean ret = ret.dtype.type(ret / rcount) AttributeError: 'torch.dtype' object has no attribute 'type' [INFO 03:50:05] absl Shutdown gracefully. [INFO 03:50:05] absl Shutdown with return code: -15

Due to the possibility of `x[1]` being of type `torch.Tensor`, the `np.mean(...)` call fails with an `AttributeError: torch.dtype object has no attribute type`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant