Comments (6)
Thanks for reporting this, what is the difference between a substrate and a scenario?
@elliottower should be able to advise on updating the environment
Could you post the follow up pickle error?
from shimmy.
Broadly speaking, a scenario is a substrate with a background population controlling some of the player roles. More formally, it is an instance of a substrate (the underlying substrate can be recovered with the _substrate
property, as with the above code, but with various modifications made to it. The following code reproduces the error:
from shimmy import MeltingPotCompatibilityV0
import supersuit as ss
from meltingpot import scenario
mp_env = scenario.build_from_config(scenario.get_config('clean_up_0'))
env = MeltingPotCompatibilityV0(env=mp_env)
env = ss.observation_lambda_v0(env, lambda x, _: x["RGB"], lambda s: s["RGB"])
env = ss.frame_stack_v1(env, 4)
env = ss.pettingzoo_env_to_vec_env_v1(env)
env = ss.concat_vec_envs_v1(env, num_vec_envs=1, num_cpus=1, base_class="stable_baselines3")
And this is the error once the adjustments to meltingpot_compatibility.py
above are made:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/dist-packages/supersuit/vector/vector_constructors.py", line 64, in concat_vec_envs_v1
vec_env = MakeCPUAsyncConstructor(num_cpus)(*vec_env_args(vec_env, num_vec_envs))
File "/usr/local/lib/python3.10/dist-packages/supersuit/vector/concat_vec_env.py", line 23, in __init__
self.vec_envs = vec_envs = [vec_env_fn() for vec_env_fn in vec_env_fns]
File "/usr/local/lib/python3.10/dist-packages/supersuit/vector/concat_vec_env.py", line 23, in <listcomp>
self.vec_envs = vec_envs = [vec_env_fn() for vec_env_fn in vec_env_fns]
File "/usr/local/lib/python3.10/dist-packages/supersuit/vector/vector_constructors.py", line 12, in env_fn
env_copy = cloudpickle.loads(cloudpickle.dumps(env))
File "/usr/local/lib/python3.10/dist-packages/cloudpickle/cloudpickle_fast.py", line 73, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.10/dist-packages/cloudpickle/cloudpickle_fast.py", line 632, in dump
return Pickler.dump(self, obj)
TypeError: cannot pickle 'dmlab2d.dmlab2d_pybind.Lab2d' object
from shimmy.
Thanks for pointing this out, not sure exactly how we would get around the pickling error—I remember running pickle errors previously as well, the lab2d objects don’t seem to be able to be serialized easily via pickle at least.
If it’s not possible to fix the pickling problem I wouldn’t be against adding support for scenarios and just having a disclaimer about the inability to pickle it.
from shimmy.
Is there a quick way to circumvent the pickling steps and make the code run?
from shimmy.
Is there a quick way to circumvent the pickling steps and make the code run?
I suspect not using supersuit
from shimmy.
Yeah unfortunately the supersuit vec env wrapper I believe uses pickling for the multi processing, so can’t really get away from that problem. Maybe if you set number of cpus to one it won’t actually do the pickling?
from shimmy.
Related Issues (20)
- Check when importing gym wrappers
- Add support for dm ai-safety-gridworlds
- Checklist for Maturity HOT 2
- Not import all compatibility wrappers in `__init__.py`
- Import issue: AttributeError: module 'pettingzoo' has no attribute 'AECEnv'
- Possibility to render multiple cameras at the same time in dm_control environments HOT 6
- Add release notes on website
- Dependencies not fixed (pettingzoo issues) HOT 1
- Broken dm_control.viewer HOT 14
- Cannot use supersuit color_reduction_v0 with Shimmy HOT 2
- PettingZoo Update breaks Shimmy HOT 1
- meaning of gym v21 HOT 2
- [Bug] incompatible with latest version of Meltingpot HOT 1
- [Bug] Melting pot wrapper fails with newer versions of pettingzoo's tests.
- MeltingPotCompatabilityV0 & supersuit concat_vec_envs HOT 5
- Bug in Shimmy v1.3.0 with DM-Control 1.0.15+: IndexError in 'torch.nn.modules.flatten' HOT 1
- Reasoning for rendering FPS for dm_control environments HOT 1
- API break with gym 26.0
- Test fail with ale-py 0.9.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shimmy.