facebookresearch / pifuhd

High-Resolution 3D Human Digitization from A Single Image.
Other
9.49k stars 1.44k forks source link

Exception: ('failed loading state dict!', './checkpoints/pifuhd.pt') #116

Open DingDongInUrMom opened 3 years ago

DingDongInUrMom commented 3 years ago

I cannot get past the following code:

PS D:\PIFuHD\pifuhd> python -m apps.simple_test Traceback (most recent call last): File "C:\Users___\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users___\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\PIFuHD\pifuhd\apps\simple_test.py", line 30, in reconWrapper(cmd, args.use_rect) File "D:\PIFuHD\pifuhd\apps\recon.py", line 220, in reconWrapper recon(opt, use_rect) File "D:\PIFuHD\pifuhd\apps\recon.py", line 163, in recon raise Exception('failed loading state dict!', state_dict_path) Exception: ('failed loading state dict!', './checkpoints/pifuhd.pt') PS D:\PIFuHD\pifuhd>

I assume it has something to do with the checkpoints directory, but I can't figure it out and I've tried several solutions. Including, but not limited to, looking through the issues threads, re-installing Python, installing Anaconda, googling for hours, and even YouTube videos covering PIFuHD. Only to come up with nothing.

DingDongInUrMom commented 3 years ago

Anyone know where to point me?

manncodes commented 3 years ago

Running the download_trained_model.sh will automatically make checkpoint directory. Problem can bad file path in windows. download_trained_model.bat for windows:

@echo off
mkdir checkpointscd checkpointswget "https://dl.fbaipublicfiles.com/pifuhd/checkpoints/pifuhd.pt" pifuhd.pt
cd ..
elduend3 commented 2 years ago

Are you trying to execute it from the home directory instead of the scripts directory? I had the same message, but it was because I was on the /scripts folder

/GIT/pifuhd$ sh ./scripts/demo.sh

Entretoize commented 2 years ago

Did you find a solution ? I have the same problem...

magnoborgo commented 2 years ago

move the "checkpoint" directory to root (same place as "apps" , "scripts" directories")

OvidWorks commented 1 year ago

Hi, I have the same problem. I downloaded the pifuhd.pt manually, and put it in checkpoints folder in the root folder. The Exception in line 163 is still raised. Thought that maybe pifuhd.pt is corrupted, I tried redownloading it with the same result...