qiuyu96 / CoDeF

[CVPR'24 Highlight] Official PyTorch implementation of CoDeF: Content Deformation Fields for Temporally Consistent Video Processing
https://qiuyu96.github.io/CoDeF/
Other
4.84k stars 385 forks source link

OSError: [Errno 32] Broken pipe #43

Closed WellTung666 closed 1 year ago

WellTung666 commented 1 year ago

Hello! when I ran ./scripts/test_multi.sh using the provided data, the following error occurred. How can I solve this problem? Thanks~

You are using a CUDA device ('NVIDIA GeForce RTX 4080') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if not hasattr(tensorboard, "__version__") or LooseVersion(
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  ) < LooseVersion("1.15"):
Testing DataLoader 0:   1%|▏                   | 1/99 [00:00<00:11,  8.50it/s]/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py:466: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
  self._proc.stdin.write(vid.tostring())
Traceback (most recent call last):
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 466, in writeFrame
    self._proc.stdin.write(vid.tostring())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 557, in <module>
    main(hparams)
  File "train.py", line 550, in main
    trainer.test(system, dataloaders=system.test_dataloader())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 706, in test
    return call._call_and_handle_interrupt(
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 42, in _call_and_handle_interrupt
    return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 92, in launch
    return function(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 749, in _test_impl
    results = self._run(model, ckpt_path=ckpt_path)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 935, in _run
    results = self._run_stage()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 971, in _run_stage
    return self._evaluation_loop.run()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 177, in _decorator
    return loop_run(self, *args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in run
    self._evaluation_step(batch, batch_idx, dataloader_idx)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 375, in _evaluation_step
    output = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 288, in _call_strategy_hook
    output = fn(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/ddp.py", line 348, in test_step
    return self.model.test_step(*args, **kwargs)
  File "train.py", line 489, in test_step
    self.video_visualizer.add(img)
  File "/home/ft/Project/CoDeF/utils/video_visualizer.py", line 95, in add
    self.video.writeFrame(frame)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 471, in writeFrame
    raise IOError(msg)
OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/home/ft/.conda/envs/VIST/bin/ffmpeg -y -f rawvideo -pix_fmt rgb24 -s 540x960 -i - -r 30.00 -s 540x960 -vcodec libx264 -crf 1 -pix_fmt yuv420p /home/ft/Project/CoDeF/results/all_sequences/scene_0/base/scene_0_base.mp4

FFMPEG STDERR OUTPUT:

Testing DataLoader 0:   1%|          | 1/99 [00:00<00:47,  2.07it/s] 
ken-ouyang commented 1 year ago

Please check whether FFMPEG is not correctly installed. Or you can disable the video output and the code will output video frames without converting it to videos.

qiuyu96 commented 1 year ago

Hello! when I ran ./scripts/test_multi.sh using the provided data, the following error occurred. How can I solve this problem? Thanks~

You are using a CUDA device ('NVIDIA GeForce RTX 4080') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if not hasattr(tensorboard, "__version__") or LooseVersion(
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  ) < LooseVersion("1.15"):
Testing DataLoader 0:   1%|▏                   | 1/99 [00:00<00:11,  8.50it/s]/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py:466: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
  self._proc.stdin.write(vid.tostring())
Traceback (most recent call last):
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 466, in writeFrame
    self._proc.stdin.write(vid.tostring())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 557, in <module>
    main(hparams)
  File "train.py", line 550, in main
    trainer.test(system, dataloaders=system.test_dataloader())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 706, in test
    return call._call_and_handle_interrupt(
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 42, in _call_and_handle_interrupt
    return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 92, in launch
    return function(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 749, in _test_impl
    results = self._run(model, ckpt_path=ckpt_path)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 935, in _run
    results = self._run_stage()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 971, in _run_stage
    return self._evaluation_loop.run()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 177, in _decorator
    return loop_run(self, *args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in run
    self._evaluation_step(batch, batch_idx, dataloader_idx)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 375, in _evaluation_step
    output = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 288, in _call_strategy_hook
    output = fn(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/ddp.py", line 348, in test_step
    return self.model.test_step(*args, **kwargs)
  File "train.py", line 489, in test_step
    self.video_visualizer.add(img)
  File "/home/ft/Project/CoDeF/utils/video_visualizer.py", line 95, in add
    self.video.writeFrame(frame)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 471, in writeFrame
    raise IOError(msg)
OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/home/ft/.conda/envs/VIST/bin/ffmpeg -y -f rawvideo -pix_fmt rgb24 -s 540x960 -i - -r 30.00 -s 540x960 -vcodec libx264 -crf 1 -pix_fmt yuv420p /home/ft/Project/CoDeF/results/all_sequences/scene_0/base/scene_0_base.mp4

FFMPEG STDERR OUTPUT:

Testing DataLoader 0:   1%|          | 1/99 [00:00<00:47,  2.07it/s] 

Try conda update ffmpeg?

WellTung666 commented 1 year ago

Please check whether FFMPEG is not correctly installed. Or you can disable the video output and the code will output video frames without converting it to videos.

I have tried, but I haven't solved the problem.

WellTung666 commented 1 year ago

Hello! when I ran ./scripts/test_multi.sh using the provided data, the following error occurred. How can I solve this problem? Thanks~

You are using a CUDA device ('NVIDIA GeForce RTX 4080') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if not hasattr(tensorboard, "__version__") or LooseVersion(
/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  ) < LooseVersion("1.15"):
Testing DataLoader 0:   1%|▏                   | 1/99 [00:00<00:11,  8.50it/s]/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py:466: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
  self._proc.stdin.write(vid.tostring())
Traceback (most recent call last):
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 466, in writeFrame
    self._proc.stdin.write(vid.tostring())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 557, in <module>
    main(hparams)
  File "train.py", line 550, in main
    trainer.test(system, dataloaders=system.test_dataloader())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 706, in test
    return call._call_and_handle_interrupt(
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 42, in _call_and_handle_interrupt
    return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 92, in launch
    return function(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 749, in _test_impl
    results = self._run(model, ckpt_path=ckpt_path)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 935, in _run
    results = self._run_stage()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 971, in _run_stage
    return self._evaluation_loop.run()
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 177, in _decorator
    return loop_run(self, *args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in run
    self._evaluation_step(batch, batch_idx, dataloader_idx)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 375, in _evaluation_step
    output = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values())
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 288, in _call_strategy_hook
    output = fn(*args, **kwargs)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/pytorch_lightning/strategies/ddp.py", line 348, in test_step
    return self.model.test_step(*args, **kwargs)
  File "train.py", line 489, in test_step
    self.video_visualizer.add(img)
  File "/home/ft/Project/CoDeF/utils/video_visualizer.py", line 95, in add
    self.video.writeFrame(frame)
  File "/home/ft/.conda/envs/VIST/lib/python3.8/site-packages/skvideo/io/ffmpeg.py", line 471, in writeFrame
    raise IOError(msg)
OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/home/ft/.conda/envs/VIST/bin/ffmpeg -y -f rawvideo -pix_fmt rgb24 -s 540x960 -i - -r 30.00 -s 540x960 -vcodec libx264 -crf 1 -pix_fmt yuv420p /home/ft/Project/CoDeF/results/all_sequences/scene_0/base/scene_0_base.mp4

FFMPEG STDERR OUTPUT:

Testing DataLoader 0:   1%|          | 1/99 [00:00<00:47,  2.07it/s] 

Try conda update ffmpeg?

It seems to solved the problem. thanks~

Zhicaiwww commented 4 months ago

It works for me to remove the ffmpeg installed by conda and use the gcc installed version. conda remove ffmpeg