yifanlu0227 / ChatSim

[CVPR2024 Highlight] Editable Scene Simulation for Autonomous Driving via LLM-Agent Collaboration
https://yifanlu0227.github.io/ChatSim
265 stars 13 forks source link

Error when compositing video #30

Closed haoyuhsu closed 3 weeks ago

haoyuhsu commented 3 weeks ago

Hi,

First, I would like to thank for your great work and really cool demos!

Recently, I've encountered a bug when testing simulation. At video composition stage, it seems like the imageio-ffmpeg package has problem being imported? I wonder what may cause this problem and how to solve it?

I've followed all steps for installation and environment setup + trained McNeRF. I did not install the trajectory tracking module since it is listed as optional.

The logs output are provided below for your reference. Thank you in advance!

use shutter                                                                               
[Inpaint] No inpainting.                                                                  
[Blender] Start rendering 50 images.                                                      
see the log in results/cache/1006_demo_2024_06_11_17_12_20/blender.log if save_cache is en
abled                                                                                     
100%|█████████████████████████████████████████████████████████████████████████████████████
████████████████████████| 50/50 [08:58<00:00, 10.76s/it]                                  
[Blender] Finish rendering 50 images.                                                     
[Blender] Copying Remaining 0 images.                                                     
[Compositing video] start...                                                              
  0%|                                                                                     
                                 | 0/50 [00:00<?, ?it/s]                                  
Traceback (most recent call last):                                                        
  File "/home/shenlong/Documents/maxhsu/ChatSim/main.py", line 136, in <module>
    chatsim.execute_funcs()                  
  File "/home/shenlong/Documents/maxhsu/ChatSim/main.py", line 124, in execute_funcs
    generate_video(self.scene, self.current_prompt)                                       
  File "/home/shenlong/Documents/maxhsu/ChatSim/chatsim/agents/utils.py", line 41, in gene
rate_video
    writer.append_data(frame)                
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio/core/fo
rmat.py", line 590, in append_data
    return self._append_data(im, total_meta)                                              
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio/plugins
/ffmpeg.py", line 587, in _append_data
    self._initialize()                       
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio/plugins
/ffmpeg.py", line 648, in _initialize
    self._write_gen.send(None)               
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_io.py", line 508, in write_frames
codec = get_first_available_h264_encoder()                                            
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_io.py", line 124, in get_first_available_h264_encoder
    compiled_encoders = get_compiled_h264_encoders()                                      
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_io.py", line 58, in get_compiled_h264_encoders
    cmd = [get_ffmpeg_exe(), "-hide_banner", "-encoders"]                                 
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_utils.py", line 28, in get_ffmpeg_exe
    exe = _get_ffmpeg_exe()                  
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_utils.py", line 44, in _get_ffmpeg_exe
    exe = os.path.join(_get_bin_dir(), FNAME_PER_PLATFORM.get(plat, ""))                  
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/site-packages/imageio_ffmpeg/
_utils.py", line 69, in _get_bin_dir
    ref = importlib.resources.files("imageio_ffmpeg.binaries") / "__init__.py"
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/importlib/resources.py", line
 147, in files
    return _common.from_package(_get_package(package))                                    
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/importlib/_common.py", line 1
4, in from_package
    return fallback_resources(package.__spec__)                                           
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/importlib/_common.py", line 1
8, in fallback_resources
    package_directory = pathlib.Path(spec.origin).parent                                  
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/pathlib.py", line 1082, in __
new__
    self = cls._from_parts(args, init=False)                                              
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/pathlib.py", line 707, in _fr
om_parts
    drv, root, parts = self._parse_args(args)                                             
  File "/home/shenlong/miniconda3/envs/chatsim/lib/python3.9/pathlib.py", line 691, in _pa
rse_args
    a = os.fspath(a)                        
TypeError: expected str, bytes or os.PathLike object, not NoneType
yifanlu0227 commented 3 weeks ago

Hi, have you tried uninstall and reinstall theimageio-ffmpeg? I didn't see this error before.

Or try to install the latest version pip install -U imageio-ffmpeg

haoyuhsu commented 3 weeks ago

After re-install image-ffmpeg to the latest version, the issue is resolved! Thanks!