lab icon indicating copy to clipboard operation
lab copied to clipboard

Details on how to use demofiles, record, video

Open ryanprinster opened this issue 5 years ago • 6 comments

I would like to be able to record my agents gameplay and save it as a video.

It would be useful to have a little bit more documentation on how to use these flags. From the python side, its unclear how the --demofiles, --record, --video, and --demo flags exposed in the random agent are used, though I can infer some through dmlab_recording.c.

I'm currently running the following commands:

bazel run :python_random_agent -- --video=NameOfAgent --demofiles="/mnt/hgfs/ryanprinster/lab/demofiles"

bazel run :python_random_agent -- --record=NameOfAgent --demofiles="/mnt/hgfs/ryanprinster/lab/demofiles"

Neither seem to do anything except create a videos/NameOfAgent and demos/NameOfAgent directories in the lab directory. After the second I get the following error after the completion of the agent training:

ERROR: Moving demo file failed: No such file or directory /tmp/dmlab_temp_folder_PqqR4U/baselab/demos/NameOfAgent/00001.dm_71 /mnt/hgfs/ryanprinster/lab/demofiles/./demos/NameOfAgent/00001.dm_71.

Note, I'm using a shared file folders on a vm, which is the reason for the weird mnt paths.

Why might I be getting these issues?

ryanprinster avatar Feb 20 '19 19:02 ryanprinster

No, seemingly this cannot be used. Try to save per frame images one by one and generate video from them.

sjtuytc avatar Jul 27 '19 00:07 sjtuytc

Hey guys,Have you ever recorded agents gameplay and save it as a video? @sjtuytc @ryanprinster

Maxwell2017 avatar Jan 12 '21 08:01 Maxwell2017

Hey guys,Have you ever recorded agents gameplay and save it as a video? @sjtuytc @ryanprinster

sure, what's your problem

sjtuytc avatar Jan 12 '21 08:01 sjtuytc

Is the flags(such as --demofiles, --record, --video, and --demo) useful?Now I'm reproducing the Impala algorithm of deepmind, but I don't know how to visualize it. I don't know if there is a suitable interface in this project? Or the way is just use cv2. imshow ('observation ', observation) frame by frame....Or the way you say(save per frame images one by one and generate video from them) THX

Maxwell2017 avatar Jan 12 '21 08:01 Maxwell2017

Is the flags(such as --demofiles, --record, --video, and --demo) useful?Now I'm reproducing the Impala algorithm of deepmind, but I don't know how to visualize it. I don't know if there is a suitable interface in this project? Or the way is just use cv2. imshow ('observation ', observation) frame by frame....Or the way you say(save per frame images one by one and generate video from them) THX

I use the latter.

sjtuytc avatar Jan 12 '21 08:01 sjtuytc

OK,thanks anyway

Maxwell2017 avatar Jan 12 '21 09:01 Maxwell2017