danieltakeshi / gym-cloth Goto Github PK
View Code? Open in Web Editor NEWCode for IROS 2020 paper: https://arxiv.org/abs/1910.04854
Code for IROS 2020 paper: https://arxiv.org/abs/1910.04854
After 9ad4ba4 I ran:
python examples/analytic.py oracle --max_episodes=5 --seed=1337 --tier=2
to get episodes in
logs/demos-2020-02-09-15-59-pol-oracle-seed-1337-obs-blender-depth-False-rgbd-True-tier2_epis_5.pkl
The images in /tmp/blender
will be 224x224. To see what the neural net would get, we can resize.
Then I ran:
python analysis/check_demo_data.py
to get these episodes, these are correctly 100x100 and have noise injected, etc:
First ep:
Second:
Third:
Fourth:
Fifth:
All right seems reasonable. Now let's scale this up. DON'T FORGET TO python setup.py install
BEFOREHAND!!
python examples/analytic.py oracle --max_episodes=400 --seed=1336 --tier=1
python examples/analytic.py oracle --max_episodes=400 --seed=1337 --tier=1
python examples/analytic.py oracle --max_episodes=400 --seed=1338 --tier=1
python examples/analytic.py oracle --max_episodes=400 --seed=1339 --tier=1
python examples/analytic.py oracle --max_episodes=400 --seed=1340 --tier=1
python examples/analytic.py oracle --max_episodes=400 --seed=1336 --tier=2
python examples/analytic.py oracle --max_episodes=400 --seed=1337 --tier=2
python examples/analytic.py oracle --max_episodes=400 --seed=1338 --tier=2
python examples/analytic.py oracle --max_episodes=400 --seed=1339 --tier=2
python examples/analytic.py oracle --max_episodes=400 --seed=1340 --tier=2
python examples/analytic.py oracle --max_episodes=400 --seed=1336 --tier=3
python examples/analytic.py oracle --max_episodes=400 --seed=1337 --tier=3
python examples/analytic.py oracle --max_episodes=400 --seed=1338 --tier=3
python examples/analytic.py oracle --max_episodes=400 --seed=1339 --tier=3
python examples/analytic.py oracle --max_episodes=400 --seed=1340 --tier=3
[I copied the data all to be on Triton4 and Mason ... and should do another machine soon just in case.]
Update: all the datasets are available on Triton4:
(py3-iros-2020) seita@triton4:~/gym-cloth (master) $ python analysis/combine_demo_data.py
just loaded demos-2020-02-09-16-31-pol-oracle-seed-1336-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl, len 400
just loaded demos-2020-02-09-16-31-pol-oracle-seed-1337-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl, len 400
just loaded demos-2020-02-09-16-31-pol-oracle-seed-1338-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl, len 400
just loaded demos-2020-02-09-16-31-pol-oracle-seed-1339-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl, len 400
just loaded demos-2020-02-09-16-31-pol-oracle-seed-1340-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl, len 400
saving at logs/demos-2020-02-09-16-31-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier1_epis_2000_COMBO.pkl, len 2000
(py3-iros-2020) seita@triton4:~/gym-cloth (master) $ python analysis/combine_demo_data.py
just loaded demos-2020-02-10-15-00-pol-oracle-seed-1336-obs-blender-depth-False-rgbd-True-tier2_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-01-pol-oracle-seed-1337-obs-blender-depth-False-rgbd-True-tier2_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-01-pol-oracle-seed-1338-obs-blender-depth-False-rgbd-True-tier2_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-02-pol-oracle-seed-1339-obs-blender-depth-False-rgbd-True-tier2_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-02-pol-oracle-seed-1340-obs-blender-depth-False-rgbd-True-tier2_epis_400.pkl, len 400
saving at logs/demos-2020-02-10-15-02-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier2_epis_2000_COMBO.pkl, len 2000
(py3-iros-2020) seita@triton4:~/gym-cloth (master) $ python analysis/combine_demo_data.py
just loaded demos-2020-02-10-15-04-pol-oracle-seed-1336-obs-blender-depth-False-rgbd-True-tier3_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-04-pol-oracle-seed-1337-obs-blender-depth-False-rgbd-True-tier3_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-04-pol-oracle-seed-1338-obs-blender-depth-False-rgbd-True-tier3_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-04-pol-oracle-seed-1339-obs-blender-depth-False-rgbd-True-tier3_epis_400.pkl, len 400
just loaded demos-2020-02-10-15-05-pol-oracle-seed-1340-obs-blender-depth-False-rgbd-True-tier3_epis_400.pkl, len 400
saving at logs/demos-2020-02-10-15-05-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier3_epis_2000_COMBO.pkl, len 2000
(py3-iros-2020) seita@triton4:~/gym-cloth (master) $
Currently these are 1.1G, 1.9G, and 2.2G, respectively, for the three tiers:
demos-2020-02-09-16-31-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier1_epis_2000_COMBO.pkl
demos-2020-02-10-15-02-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier2_epis_2000_COMBO.pkl
demos-2020-02-10-15-05-pol-oracle-seed-1336_to_1340-obs-blender-depth-False-rgbd-True-tier3_epis_2000_COMBO.pkl
And then running the analysis script analysis/check_demo_data.py
I am getting this for T1:
loaded data, length (i.e., episodes) 2000
episode lengths (wrt t): max / min / mean: 6.0 / 1.0 / 1.80 +/- 0.8
num_oob: 0
num_tear: 0
num coverage below 0.9: 0
total transitions: 3599
coverage at start: 78.0 +/- 7.1
coverage at end: 95.6 +/- 2.1
inv-var at start: 0.962 +/- 0.5
inv-var at end: 11.582 +/- 41.6
actions, len 14396, max 1.423, min -1.316, mean -0.008
average values across three channels
chan. 1: 157.9 +/- 69.0
chan. 2: 107.7 +/- 32.0
chan. 3: 78.7 +/- 14.2
and this for T2:
loaded data, length (i.e., episodes) 2000
episode lengths (wrt t): max / min / mean: 10.0 / 1.0 / 3.94 +/- 2.0
num_oob: 6
num_tear: 0
num coverage below 0.9: 51
total transitions: 7878
coverage at start: 57.5 +/- 6.1
coverage at end: 94.5 +/- 5.1
inv-var at start: 0.745 +/- 0.1
inv-var at end: 10.177 +/- 14.0
actions, len 31512, max 1.312, min -1.333, mean 0.001
average values across three channels
chan. 1: 155.5 +/- 66.6
chan. 2: 110.5 +/- 34.6
chan. 3: 85.0 +/- 19.6
and this for T3:
loaded data, length (i.e., episodes) 2000
episode lengths (wrt t): max / min / mean: 10.0 / 1.0 / 4.64 +/- 1.1
num_oob: 3
num_tear: 0
num coverage below 0.9: 7
total transitions: 9276
coverage at start: 41.2 +/- 3.4
coverage at end: 95.0 +/- 2.7
inv-var at start: 0.231 +/- 0.1
inv-var at end: 9.329 +/- 15.4
actions, len 37104, max 1.247, min -1.263, mean -0.001
average values across three channels
chan. 1: 151.9 +/- 65.5
chan. 2: 113.1 +/- 37.0
chan. 3: 90.5 +/- 24.5
Makes sense! Similar to results that I was getting before.
Now the next step is to start training ...
Hi,
I tried to render in Ubuntu 20 but the render window does not update.
I created a fix in my fork commit by modifying render/src/main.cpp
commit e810634ae4662f59973d04cbecd62eabe1aa9ae8.
Hi, first thanks for this great repo!
I have created a new environment following the given ClothEnv
to perform diagonal folding.
The changes can be found in my fork gym-cloth in the file DiagonalClothEnv.
I modified the original code and works as:
self.gripper.adjust(x=delta_x, y=delta_y, z=delta_z)
instead of self._pull()
for i in range(cloth_updates): self.cloth.update()
However, the grasped points pt.pinned = True
don't behave as expected.
In the first iteration t=0, I take an action in the z coordinate and pull the cloth by 0.007. This works as expected and the grasped points are then at z=0.007.
At t=1, I apply the same action on the z coordinate, self.gripper.adjust(x=0., y=0., z=0.007)
. This should move the grasped points to z=0.014.
However, after performing the first self.cloth.update()
the grasped points are at z=0.021.
Why do the graspped points pt.pinned=True
move to a different position after the update?
I run the example line and the simulation window pops up as expected. However after a few seconds.
Traceback (most recent call last):
File "examples/analytic.py", line 788, in <module>
run(args, policy)
File "examples/analytic.py", line 708, in run
obs = env.reset()
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/site-packages/gym_cloth-0.0.1-py3.6-linux-x86_64.egg/gym_cloth/envs/cloth_env.py", line 795, in reset
obs = self.state
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/site-packages/gym_cloth-0.0.1-py3.6-linux-x86_64.egg/gym_cloth/envs/cloth_env.py", line 204, in state
img_rgb = self.get_blender_rep('False')
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/site-packages/gym_cloth-0.0.1-py3.6-linux-x86_64.egg/gym_cloth/envs/cloth_env.py", line 281, in get_blender_rep
str(self.dom_rand_params['specular_max'])
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/subprocess.py", line 287, in call
with Popen(*popenargs, **kwargs) as p:
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/subprocess.py", line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'blender': 'blender'
I follow the installations instructions on an Ubuntu 18.04 system until the example it works fine. but then I get.
(py3-cloth) dhananjay@dhananjay-G7-7700:~/Desktop/gym-cloth$ python examples/analytic.py oracle --max_episodes=400 --seed=1336 --tier=1
Yes, cython compiled.
Our result_path:
/home/dhananjay/Desktop/gym-cloth/examples/../logs/demos-2021-06-25-11-59-pol-oracle-seed-1336-obs-blender-depth-False-rgbd-True-tier1_epis_400.pkl
06-25 11:59:36 cloth_env : DEBUG Just re-seeded env to: 8952872158261658479
06-25 11:59:36 cloth_env : DEBUG Just re-seeded env to: 1336
Traceback (most recent call last):
File "examples/analytic.py", line 788, in <module>
run(args, policy)
File "examples/analytic.py", line 697, in run
env.render(filepath=args.render_path)
File "/home/dhananjay/miniconda3/envs/py3-cloth/lib/python3.6/site-packages/gym_cloth-0.0.1-py3.6-linux-x86_64.egg/gym_cloth/envs/cloth_env.py", line 1066, in render
os.chdir(filepath)
FileNotFoundError: [Errno 2] No such file or directory: '/home/dhananjay/Desktop/gym-cloth/examples/../render/build'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.