facebookresearch / denoised_mdp

Open source code for paper "Denoised MDPs: Learning World Models Better Than the World Itself"
Other
134 stars 11 forks source link

Error in robodesk: ValueError: No way to determine width or height from video. #8

Closed AlexLiuyuren closed 1 year ago

AlexLiuyuren commented 1 year ago

I tried to reproduce results in the robot tv_green_hue environment. I run across such errors when loading the videos.

2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/interaction.py", line 124, in env_interact
2022-12-16 17:25:14 [ERROR]      observation, info = env.reset()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/utils.py", line 74, in reset
2022-12-16 17:25:14 [ERROR]      observation, info = self.non_auto_reset_env.reset()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/__init__.py", line 73, in reset
2022-12-16 17:25:14 [ERROR]      obs = self.inner.reset()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/robodesk.py", line 345, in reset
2022-12-16 17:25:14 [ERROR]      return self._get_obs()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/robodesk.py", line 500, in _get_obs
2022-12-16 17:25:14 [ERROR]      return {'image': self.render(resize=True),
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/anaconda3/envs/interp/lib/python3.8/site-packages/gym/core.py", line 66, in render
2022-12-16 17:25:14 [ERROR]      return render_func(self, *args, **kwargs)
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/robodesk.py", line 223, in render
2022-12-16 17:25:14 [ERROR]      m.pre_render()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/utils.py", line 567, in pre_render
2022-12-16 17:25:14 [ERROR]      self.ensure_mujoco_updated()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/utils.py", line 594, in ensure_mujoco_updated
2022-12-16 17:25:14 [ERROR]      self.ensure_texure_updated()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/utils.py", line 573, in ensure_texure_updated
2022-12-16 17:25:14 [ERROR]      img = self.tv_source.get_image()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/video_source.py", line 131, in get_image
2022-12-16 17:25:14 [ERROR]      [s.get_image() for s in self.sources],
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/video_source.py", line 131, in <listcomp>
2022-12-16 17:25:14 [ERROR]      [s.get_image() for s in self.sources],
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/video_source.py", line 103, in get_image
2022-12-16 17:25:14 [ERROR]      self.load_frames_if_needed()
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/research/denoised_mdp/denoised_mdp/envs/robodesk/robodesk/robodesk/video_source.py", line 70, in load_frames_if_needed
2022-12-16 17:25:14 [ERROR]      video = skvideo.io.vread(video_f)
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/anaconda3/envs/interp/lib/python3.8/site-packages/skvideo/io/io.py", line 144, in vread
2022-12-16 17:25:14 [ERROR]      reader = FFmpegReader(fname, inputdict=inputdict, outputdict=outputdict, verbosity=verbosity)
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/anaconda3/envs/interp/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 44, in __init__
2022-12-16 17:25:14 [ERROR]      super(FFmpegReader,self).__init__(*args, **kwargs)
2022-12-16 17:25:14 [ERROR]    File "/nfs/users/ext_yuren.liu/anaconda3/envs/interp/lib/python3.8/site-packages/skvideo/io/abstract.py", line 115, in __init__
2022-12-16 17:25:14 [ERROR]      raise ValueError(
2022-12-16 17:25:14 [ERROR]  ValueError: No way to determine width or height from video. Need `-s` in `inputdict`. Consult documentation on I/O.

The command line to run experiments is shown as follows:

env CUDA_VISIBLE_DEVICES=0 EGL_DEVICE_ID=0 KINETICS_DIR=/nfs/users/ext_yuren.liu/research/kinetics-downloader/dataset HYDRA_FULL_ERROR=1 python main.py env.kind=robodesk env.spec=tv_green_hue_noisy learning.model_learning.kl.alpha=2 learning.model_learning.kl.beta_y=0.125 learning.model_learning.kl.beta_z=0.125 seed=12

I downloaded many videos as readme.md suggested. (about 33G) in this directory. /nfs/users/ext_yuren.liu/research/kinetics-downloader/dataset/train/driving_car .

image

I try to solve this problem by searching on google. The following answer does not work for me because the error occured when the first video was loaded.

https://github.com/scikit-video/scikit-video/issues/60

ssnl commented 1 year ago

I'm not sure why some of your files are XXXX.f140. Maybe that's the issue? I want to ask for some details. Can you send me an email at tongzhou@mit.edu?