avatarify-python icon indicating copy to clipboard operation
avatarify-python copied to clipboard

Runtime Error grab frame from camera

Open Threepwood77 opened this issue 6 years ago • 5 comments

Hello,

I'm on Windows 10 I installed the softwares with no problem. then I do the run_windows.bat, and I systematically get this error:

load checkpoints.. [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1159) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638 [ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1159) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638 Traceback (most recent call last): File "cam_fomm.py", line 233, in cap.start() File "C:\Users\Klarisse\Desktop\avatarify-master\avatarify\videocaptureasync.py", line 44, in start raise RuntimeError(f"Failed to succesfully grab frame from the camera (timeout={WARMUP_TIMEOUT}s). Try to restart.") RuntimeError: Failed to succesfully grab frame from the camera (timeout=10.0s). Try to restart.

what can I do ? thanks for your help.

Threepwood77 avatar Apr 23 '20 16:04 Threepwood77

Try different camids in scripts/settings.sh I have изображение so CAMID=3 works for me

gopito avatar Apr 24 '20 12:04 gopito

Hey @gopito I was able to run avatarify after setting CAMID=6 but the issue I have now is that the FPS is running at 2.9 fps to 3 fps... Do you have any idea why? I'm using windows 11 Nvidia RTX 3050ti 16 gb ram.... Also here is a photo of the suggestion I got from them but I don't know how to edit such file Screenshot (6)

BiggestDad avatar Apr 07 '23 06:04 BiggestDad

Hey @JohanAR I wish to lodge your attention towards this issue... Do you have any idea of the above issue I'm having?

BiggestDad avatar Apr 07 '23 06:04 BiggestDad

(base) C:\Users\user\Desktop\avatarify-python>run_windows.bat [1755089477.634638] Loading Predictor C:\Users\user\AppData\Roaming\Python\Python38\site-packages\torch\functional.py:513: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3610.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] C:\Users\user\Desktop\avatarify-python\afy\predictor_local.py:66: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load(self.checkpoint_path, map_location=self.device) [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1159) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638 [ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1159) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638 Traceback (most recent call last): File "afy/cam_fomm.py", line 227, in cap.start() File "C:\Users\user\Desktop\avatarify-python\afy\videocaptureasync.py", line 45, in start raise RuntimeError(f"Failed to succesfully grab frame from the camera (timeout={WARMUP_TIMEOUT}s). Try to restart.") RuntimeError: Failed to succesfully grab frame from the camera (timeout=10.0s). Try to restart.

Mumzkid4 avatar Aug 13 '25 12:08 Mumzkid4

@King_Gabos on telegram only a small token

Nene020911 avatar Aug 13 '25 13:08 Nene020911