wyhsirius / LIA

[ICLR 22, TPAMI 24] Latent Image Animator
https://wyhsirius.github.io/LIA-project/
Other
585 stars 63 forks source link

error PyAV av.error.FileNotFoundError: [Errno 2] No such file or directory #2

Open loboere opened 2 years ago

loboere commented 2 years ago

first error

!python run_demo.py --model vox --source_path /content/LIA/data/vox/241.jpg --driving_path /content/LIA/data/vox/faceexp2.mp4 --save_folder  /content/LIA/res # using vox model
==> loading model
==> loading data
Traceback (most recent call last):
  File "run_demo.py", line 110, in <module>
    demo = Demo(args)
  File "run_demo.py", line 72, in __init__
    self.vid_target, self.fps = vid_preprocessing(args.driving_path)
  File "run_demo.py", line 31, in vid_preprocessing
    vid_dict = torchvision.io.read_video(vid_path, pts_unit='sec')
  File "/usr/local/lib/python3.7/dist-packages/torchvision/io/video.py", line 273, in read_video
    _check_av_available()
  File "/usr/local/lib/python3.7/dist-packages/torchvision/io/video.py", line 42, in _check_av_available
    raise av
ImportError: PyAV is not installed, and is necessary for the video operations in torchvision.
See https://github.com/mikeboers/PyAV#installation for instructions on how to
install PyAV on your system.
!pip install av
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting av
  Downloading av-9.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.2 MB)
     |████████████████████████████████| 28.2 MB 1.2 MB/s 
Installing collected packages: av
Successfully installed av-9.2.0

second error

!python run_demo.py --model vox --source_path /content/LIA/data/vox/241.jpg --driving_path /content/LIA/data/vox/faceexp2.mp4 --save_folder  /content/LIA/res # using vox model
==> loading model
==> loading data
==> running
  0% 0/1273 [00:00<?, ?it/s]/content/LIA/networks/styledecoder.py:439: UserWarning: torch.qr is deprecated in favor of torch.linalg.qr and will be removed in a future PyTorch release.
The boolean parameter 'some' has been replaced with a string parameter 'mode'.
Q, R = torch.qr(A, some)
should be replaced with
Q, R = torch.linalg.qr(A, 'reduced' if some else 'complete') (Triggered internally at  ../aten/src/ATen/native/BatchLinearAlgebra.cpp:1980.)
  Q, R = torch.qr(weight)  # get eignvector, orthogonal [n1, n2, n3, n4]
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:4194: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
  "Default grid_sample and affine_grid behavior has changed "
100% 1273/1273 [01:12<00:00, 17.61it/s]
Traceback (most recent call last):
  File "run_demo.py", line 111, in <module>
    demo.run()
  File "run_demo.py", line 93, in run
    save_video(vid_target_recon, self.save_path, self.fps)
  File "run_demo.py", line 44, in save_video
    torchvision.io.write_video(save_path, vid[0], fps=fps)
  File "/usr/local/lib/python3.7/dist-packages/torchvision/io/video.py", line 135, in write_video
    container.mux(packet)
  File "av/container/output.pyx", line 211, in av.container.output.OutputContainer.mux
  File "av/container/output.pyx", line 217, in av.container.output.OutputContainer.mux_one
  File "av/container/output.pyx", line 172, in av.container.output.OutputContainer.start_encoding
  File "av/error.pyx", line 336, in av.error.err_check
av.error.FileNotFoundError: [Errno 2] No such file or directory
wyhsirius commented 2 years ago

@loboere Hi, for second error, create a ./res folder then run the command

loboere commented 2 years ago

I already created the folder but it still gives the same error

wyhsirius commented 2 years ago

@loboere I see, you have to create ./res/vox manually. Now it should be ok, I have updated run_demo.py, the folder will be created automatically.