Comments (5)
-
SocialRobot should run in the same thread that it is created because of its inner implementation (gazebo::sensors) . There are three options to solve this to work with tf_agents: 1) move the creation from main thread to
BatchedPyEnvironment
2) usingParallelPyEnvironment
3) wrap gazebo interface in one thread . Since gazebo can not spawn multi instances by multi-threads 1) and 3) is not necessery -
tf_agents support parallel environments using multi-threads (
BatchedPyEnvironment
) or mutil-process (ParallelPyEnvironment
) -
example to work with tf_agents
train_eval.py
train_eval.patch diff with tf_agents/agents/ddpg/examples/v2/train_eval.py
from alf.
Is it possible to make some wrap for socialrobot environment so that we don't need to change tf_agents code to run with social robot environment? It will be cool if that's possible.
from alf.
Is it possible to make some wrap for socialrobot environment so that we don't need to change tf_agents code to run with social robot environment? It will be cool if that's possible.
All examples in tf_agents (tf_agents/agents/*/examples/v*/*
) creates at least two environments tf_env
(created in self process by BatchedPyEnvironment
or created in new process by ParallelPyEnvironment
for collect data) and eval_tf_env
(one instance created in self process for test ) .
Since many singletons implementation in gazebo and multi instances in one process is not supported, partial examples that created tf_env
and eval_tf_env
in the same process can not run without changing code . Besides, different port should be specified explicitly or generate randomly for each gazebo instance .
from alf.
A possible implementation would be to wrap socialbot using ProcessPyEnvironment in socialbot_suite. For port, we can automatically do increment from a given starting port (from environment). So it can be used in the same way as other environment.
from alf.
A possible implementation would be to wrap socialbot using ProcessPyEnvironment in socialbot_suite. For port, we can automatically do increment from a given starting port (from environment). So it can be used in the same way as other environment.
with commit update wrap with process and config.gin :
import alf.environments.suite_socialbot
train_eval.env_name = "SocialBot-Pr2Gripper-v0"
train_eval.env_load_fn = @suite_socialbot.load
train_eval.num_parallel_environments = 2suite_socialbot.load.wrap_with_process = False # recommend set to False when num_parallel_environments > 2
we can run trainning as
python -m tf_agents.agents.ddpg.examples.v2.train_eval --gin_file=config.gin --root_dir=~/tmp/ddpg/socialbot/Pr2Gripper
from alf.
Related Issues (20)
- Exception from get_nested_field() does not stop the training
- Exclude red-light events triggered after passing the traffic light
- About Allocating Custom Environment HOT 3
- high performance parallel environment (C++ based envppool)
- Apple M1 GPU - PyTorch "mps" backend support HOT 1
- multi-gpu training issue
- Extended sensor suites (obstacle, dynamic object, red-light etc)
- documentation not generated
- Interferenceless Parallel Carla Environment
- API change to policy_trainer._step makes CI stuck without informative error message HOT 1
- Imitation for Driving (code + doc) HOT 1
- How to get to the next step the AlfGymWrapper class HOT 3
- How to get which Vehicle light state of each actor ? HOT 2
- Dormant/Collided vehicles disappear even after commenting lines in ALSM.CPP HOT 2
- Offline Buffer with Disk Storage Option
- Need to upgrade the CI ubuntu version HOT 1
- ModuleNotFoundError: No module named '_cnest' HOT 5
- Need to update pytorch version for better GPU cards HOT 1
- fast parallel env sometimes hangs after ctrl+c
- TypeError: configurable() got an unexpected keyword argument 'whitelist' HOT 10
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 alf.