Skip to content

Commit 5bf7988

Browse files
authored
Merge pull request #502 from kengz/master
update book branch v4.2.4
2 parents 2eaec2c + 667ba73 commit 5bf7988

File tree

6 files changed

+24
-32
lines changed

6 files changed

+24
-32
lines changed

environment-byo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ dependencies:
1414
- pandas=0.24.2
1515
- pillow=6.2.0
1616
- pip=19.1.1
17-
- plotly-orca=1.3.0
18-
- plotly=4.5.4
17+
- plotly=4.9.0
1918
- psutil=5.6.2
2019
- pycodestyle=2.5.0
2120
- pydash=4.2.1
@@ -33,6 +32,7 @@ dependencies:
3332
- cloudpickle==0.5.2
3433
- colorlover==0.3.0
3534
- future==0.18.2
35+
- kaleido==0.2.1
3636
- opencv-python==4.1.0.25
3737
- pyopengl==3.1.0
3838
- ray==0.7.0

environment.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ dependencies:
1515
- pandas=0.24.2
1616
- pillow=6.2.0
1717
- pip=19.1.1
18-
- plotly-orca=1.3.0
19-
- plotly=4.5.4
18+
- plotly=4.9.0
2019
- psutil=5.6.2
2120
- pycodestyle=2.5.0
2221
- pydash=4.2.1
@@ -31,20 +30,21 @@ dependencies:
3130
- ujson=1.35
3231
- xlrd=1.2.0
3332
- pip:
34-
- box2d-py==2.3.8
35-
- cloudpickle==0.5.2
36-
- colorlover==0.3.0
37-
- future==0.18.2
38-
- opencv-python==4.1.0.25
39-
- pyopengl==3.1.0
40-
- ray==0.7.0
41-
- redis==2.10.6
42-
- tensorboard==2.1.1
43-
- xvfbwrapper==0.2.9
44-
- gym==0.12.1
45-
- gym[atari]
46-
- gym[box2d]
47-
- gym[classic_control]
48-
- pybullet==2.8.4
49-
- roboschool==1.0.46
50-
- atari-py==0.2.6
33+
- box2d-py==2.3.8
34+
- cloudpickle==0.5.2
35+
- colorlover==0.3.0
36+
- future==0.18.2
37+
- kaleido==0.2.1
38+
- opencv-python==4.1.0.25
39+
- pyopengl==3.1.0
40+
- ray==0.7.0
41+
- redis==2.10.6
42+
- tensorboard==2.1.1
43+
- xvfbwrapper==0.2.9
44+
- gym==0.12.1
45+
- gym[atari]
46+
- gym[box2d]
47+
- gym[classic_control]
48+
- pybullet==2.8.4
49+
- roboschool==1.0.46
50+
- atari-py==0.2.6

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"retro_analyze": "python -c 'import sys; from slm_lab.experiment import retro_analysis; retro_analysis.retro_analyze(sys.argv[1])'",
1010
"retro_eval": "python -c 'import sys; from slm_lab.experiment import retro_analysis; retro_analysis.retro_eval(sys.argv[1])'",
1111
"reset": "rm -rf data/* .cache __pycache__ */__pycache__ *egg-info .pytest* htmlcov .coverage* *.xml",
12-
"kill": "pkill -f run_lab; pkill -f slm-env; pkill -f ipykernel; pkill -f ray; pkill -f orca; pkill -f Xvfb; ps aux | grep -i Unity | awk '{print $2}' | xargs sudo kill -9",
12+
"kill": "pkill -f run_lab; pkill -f slm-env; pkill -f ipykernel; pkill -f ray; pkill -f Xvfb; ps aux | grep -i Unity | awk '{print $2}' | xargs sudo kill -9",
1313
"update": "conda env update -f environment.yml; yarn install;",
1414
"export-env": "conda env export > environment.yml",
1515
"build": "docker build -t kengz/slm_lab:latest -t kengz/slm_lab:v$v .",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def run_tests(self):
3636

3737
setup(
3838
name='slm_lab',
39-
version='4.2.3',
39+
version='4.2.4',
4040
description='Modular Deep Reinforcement Learning framework in PyTorch.',
4141
long_description='https://github.com/kengz/slm_lab',
4242
keywords='SLM Lab',

slm_lab/experiment/analysis.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ def analyze_session(session_spec, session_df, df_mode, plot=True):
254254
# plot graph
255255
viz.plot_session(session_spec, session_metrics, session_df, df_mode)
256256
viz.plot_session(session_spec, session_metrics, session_df, df_mode, ma=True)
257-
# manually shut down orca server to avoid zombie processes
258-
viz.pio.orca.shutdown_server()
259257
return session_metrics
260258

261259

@@ -267,8 +265,6 @@ def analyze_trial(trial_spec, session_metrics_list):
267265
# plot graphs
268266
viz.plot_trial(trial_spec, trial_metrics)
269267
viz.plot_trial(trial_spec, trial_metrics, ma=True)
270-
# manually shut down orca server to avoid zombie processes
271-
viz.pio.orca.shutdown_server()
272268
# zip files
273269
if util.get_lab_mode() == 'train':
274270
predir, _, _, _, _ = util.prepath_split(info_prepath)
@@ -287,8 +283,6 @@ def analyze_experiment(spec, trial_data_dict):
287283
# plot graph
288284
viz.plot_experiment(spec, experiment_df, METRICS_COLS)
289285
viz.plot_experiment_trials(spec, experiment_df, METRICS_COLS)
290-
# manually shut down orca server to avoid zombie processes
291-
viz.pio.orca.shutdown_server()
292286
# zip files
293287
predir, _, _, _, _ = util.prepath_split(info_prepath)
294288
zipdir = util.smart_path(predir)

slm_lab/lib/viz.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
pio.templates.default = 'none' # set default white background for plots
1313
# moving-average window size for plotting
1414
PLOT_MA_WINDOW = 100
15-
# warn orca failure only once
16-
orca_warn_once = ps.once(lambda e: logger.warning(f'Failed to generate graph. Run retro-analysis to generate graphs later. {e}\nIf running on a headless server, prepend your Python command with `xvfb-run -a `, for example `xvfb-run -a python run_lab.py`'))
1715
if util.is_jupyter():
1816
init_notebook_mode(connected=True)
1917

@@ -121,7 +119,7 @@ def save_image(figure, filepath):
121119
try:
122120
pio.write_image(figure, filepath, scale=2)
123121
except Exception as e:
124-
orca_warn_once(e)
122+
logger.warning(f'Failed to generate graph. Run retro-analysis to generate graphs later. {e}\nIf running on a headless server, prepend your Python command with `xvfb-run -a `, for example `xvfb-run -a python run_lab.py`')
125123

126124

127125
# analysis plot methods

0 commit comments

Comments
 (0)