Local Mode - TypeError: unhashable type: 'list'
See original GitHub issueI’m training an A3C trainer with Pytorch and tune.run().
tune.run(a3c.A3CTrainer, local_dir=".", stop={"episode_reward_mean": 0.5},
resources_per_trial={"cpu":1, "gpu":1},
config={"env": "my_env",
"use_pytorch": True,
"model": {"custom_model": "my_model"},
"num_workers": 1,
"train_batch_size": 32,
"sample_batch_size": 16,
"num_envs_per_worker": 1,
})
I’m getting the error File "/mnt/miniconda/envs/proteus_rl_env/lib/python3.6/site-packages/ray/rllib/optimizers/async_gradients_optimizer.py", line 43, in step pending_gradients[future] = e TypeError: unhashable type: 'list'
The same code with another trainer, i.e, PGTrainer is working:
tune.run(pg.PGTrainer, local_dir=".", stop={"episode_reward_mean": 0.5},
resources_per_trial={"cpu":1, "gpu":1},
config={"env": "my_env",
"use_pytorch": True,
"model": {"custom_model": "my_model"},
"num_workers": 1,
"train_batch_size": 32,
"sample_batch_size": 16,
"num_envs_per_worker": 1,
})
Are there some specific changes to be done while running the A3C trainer?
Any leads will be appreciated!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Python: TypeError: unhashable type: 'list' - Net-Informations.Com
This error shows that the my_dict key [1,2,3] is List and List is not a hashable type in Python . Dictionary keys must...
Read more >How to overcome TypeError: unhashable type: 'list' [duplicate]
The solution to avoid this error is to restructure the list to have nested tuples instead of lists. Share.
Read more >How to Handle Unhashable Type List Exceptions in Python
The Python TypeError: Unhashable Type: 'list' happens when a mutable list, instead of an immutable tuple, is used as a hash argument.
Read more >You have any idea, how fix TypeError: unhashable type: 'list'
Now this is just a guess, but I would guess that a list is not a hashable entity. ... Quote: Most of Python's...
Read more >TypeError: unhashable type: 'dict' - Discussions on Python.org
When I looked at your code again I think you first need to do some simpler exercises with the basic data types (...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK this should be fixed in the release; closing for now but reopen if needed.
I think this is fixed in the upcoming release (0.7.3). If you need the feature now, you can install the latest snapshot of master (https://ray.readthedocs.io/en/latest/installation.html#trying-snapshots-from-master)