flow icon indicating copy to clipboard operation
flow copied to clipboard

Fail to save video

Open SHITIANYU-hue opened this issue 4 years ago • 1 comments

Bug Description

A clear and concise description of the bug and what you expected to happen.

Bug Reproduce

File in which the bug occurred: file.py

The exact command that you did run that caused the bug: i run the tutorial 4 visualization chapter, i set the --save_render to true, but cannot save video

Output Log

Traceback (most recent call last): File "visualizer_rllib.py", line 386, in visualizer_rllib(args) File "visualizer_rllib.py", line 204, in visualizer_rllib state = env.reset() File "/home/tianyushi/code/flow-master/flow/envs/ring/wave_attenuation.py", line 210, in reset return super().reset() File "/home/tianyushi/code/flow-master/flow/envs/base.py", line 555, in reset observation, _, , _ = self.step(rl_actions=None) File "/home/tianyushi/code/flow-master/flow/envs/base.py", line 385, in step self.render() File "/home/tianyushi/code/flow-master/flow/envs/base.py", line 732, in render self.k.kernel_api.gui.screenshot("View #0", self.path+"/frame%06d.png" % self.time_counter) AttributeError: 'WaveAttenuationPOEnv' object has no attribute 'path' Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/home/tianyushi/code/flow-master/flow/envs/base.py", line 694, in terminate images_dir = self.path.split('/')[-1] AttributeError: 'WaveAttenuationPOEnv' object has no attribute 'path'

Screenshots

Screenshots:

picture name

Versions

SHITIANYU-hue avatar Mar 29 '20 21:03 SHITIANYU-hue

I think this broke with #836, particularly because of line 135: https://github.com/flow-project/flow/blob/bc65245504e590604ffa3a49376e3367c318a475/flow/envs/base.py#L134-L136

which now fails to hit this conditional statement: https://github.com/flow-project/flow/blob/bc65245504e590604ffa3a49376e3367c318a475/flow/envs/base.py#L221-L225

A quick fix seems is to change self.sim_params.render to self.should_render in line 223.

temetski avatar Mar 06 '21 00:03 temetski