run_windows.bat raises a RuntimeError
I'm trying to run avatarify on Windows 10, I'm pretty sure to have installed everything correctly, but every time I try to run run_windows.bat I get this error:
Traceback (most recent call last):
File "cam_fomm.py", line 219, in <module>
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=True, device=device)
File "C:\Users\Alberto\miniconda3\envs\avatarify\lib\site-packages\face_alignment\api.py", line 78, in __init__
fan_weights = load_url(models_urls[network_name], map_location=lambda storage, loc: storage)
File "C:\Users\Alberto\miniconda3\envs\avatarify\lib\site-packages\torch\hub.py", line 506, in load_state_dict_from_url
return torch.load(cached_file, map_location=map_location)
File "C:\Users\Alberto\miniconda3\envs\avatarify\lib\site-packages\torch\serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Alberto\miniconda3\envs\avatarify\lib\site-packages\torch\serialization.py", line 709, in _legacy_load
deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 640133 more bytes. The file might be corrupted.
Any idea?
I can't comment on your specific error, but I just setup on Windows 10 and I don't see the same error. Perhaps try clone the repo again?
Output from the script on my machine:
(avatarify) c:\GIT_Repos\avatarify>run_windows.bat
(avatarify) c:\GIT_Repos\avatarify>REM Web-camera device id
(avatarify) c:\GIT_Repos\avatarify>set CAMID=0
(avatarify) c:\GIT_Repos\avatarify>REM ################################################
(avatarify) c:\GIT_Repos\avatarify>REM Normally you don't want to change settings below
(avatarify) c:\GIT_Repos\avatarify>REM Conda environment name
(avatarify) c:\GIT_Repos\avatarify>set CONDA_ENV_NAME=avatarify
(avatarify) c:\GIT_Repos\avatarify>REM @set /P CAMID="Pick the webcam id you want to use (typically "0"): "
0: ./avatars\einstein.jpg
1: ./avatars\eminem.jpg
2: ./avatars\jobs.jpg
3: ./avatars\mona.jpg
4: ./avatars\obama.jpg
5: ./avatars\potter.jpg
6: ./avatars\ronaldo.png
7: ./avatars\schwarzenegger.png
load checkpoints..
cam_fomm.py:35: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config = yaml.load(f)
Downloading: "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth" to C:\Users\stuart/.cache\torch\checkpoints\s3fd-619a316812.pth
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 85.7M/85.7M [00:37<00:00, 2.39MB/s]
Downloading: "https://www.adrianbulat.com/downloads/python-fan/2DFAN4-11f355bf06.pth.tar" to C:\Users\stuart/.cache\torch\checkpoints\2DFAN4-11f355bf06.pth.tar
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 91.2M/91.2M [00:36<00:00, 2.63MB/s]
Traceback (most recent call last):
File "cam_fomm.py", line 238, in
(avatarify) c:\GIT_Repos\avatarify>
I tried reinstalling everything, but I get the same exact error
@AlbyIanna did you interrupt downloading files at the first run_windows.bat call?
@virtualmonster Looks like you have an unsupported GPU. GTX somethng I guess?
@alievk yes, its a GTX Titan... it supports CUDA but from what I read in the specs, it supported CUDA 3.5 at release. I installed CUDA 10.x and there were no errors
@virtualmonster could you explain in more detail how you fixed the problem?
I have a GTX 860M
@AlbyIanna did you interrupt downloading files at the first run_windows.bat call?
@alievk I think so, but I'm not 100% sure. How do I check if everthing has been installed correctly?
Okay, I solved it. I found out that torch/serialization.py was trying to access three tar files at 'C:\\Users\\[my_username]/.cache\\torch\\checkpoints\\, but after opening my .cache folder in my home, one of them was missing. So I deleted the checkpoints folder, then I re-ran run_windows.bat and it worked perfectly. Thanks!
I had a CUDA pop-up error window when running, but strangely it then started fine anyway.
@alievk yes, its a GTX Titan... it supports CUDA but from what I read in the specs, it supported CUDA 3.5 at release. I installed CUDA 10.x and there were no errors
I had quite same problem and I was suggeted to install pytorch from source. However I still doesnt work correctly.
run_windows.bat
Problem complement:This is what I sent to my friend after the successful run, and this is the problem with his run
As it look (and said before) you have some kind of connection issue. Bad firewall or unstable internet connection.
This is my run_windows.bat
And nothing happened after that.
What should I do?
GTX1660Ti
Closing issue since OP's problem is solved. Please open a separate issue is anything else mentioned in this conversation (better handling of network errors?) should be considered a bug in Avatarify.
Okay, I solved it. I found out that
torch/serialization.pywas trying to access three tar files at'C:\\Users\\[my_username]/.cache\\torch\\checkpoints\\, but after opening my.cachefolder in my home, one of them was missing. So I deleted thecheckpointsfolder, then I re-ranrun_windows.batand it worked perfectly. Thanks!
Please i'm going through same thing.. can you assist me how you got yours done so i get mine done ?
I don’t have your WhatsApp can you share with me ?
On Sat, 5 Aug 2023 at 1:27 PM, SanPatrick01 @.***> wrote:
Snap your problem to my WhatsApp please
— Reply to this email directly, view it on GitHub https://github.com/alievk/avatarify-python/issues/65#issuecomment-1666396868, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBXGZ6FLOBHGMNCN36NEJ4TXTXKUFANCNFSM4MLSRG7Q . You are receiving this because you commented.Message ID: @.***>
My WhatsApp number +60166227040, pls anyone can help me sort it out
On Sat, 5 Aug 2023 at 4:05 PM, Papi @.***> wrote:
I don’t have your WhatsApp can you share with me ?
On Sat, 5 Aug 2023 at 1:27 PM, SanPatrick01 @.***> wrote:
Snap your problem to my WhatsApp please
— Reply to this email directly, view it on GitHub https://github.com/alievk/avatarify-python/issues/65#issuecomment-1666396868, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBXGZ6FLOBHGMNCN36NEJ4TXTXKUFANCNFSM4MLSRG7Q . You are receiving this because you commented.Message ID: @.***>