Giter Site home page Giter Site logo

Comments (3)

Xiaoming-Zhao avatar Xiaoming-Zhao commented on July 19, 2024

From the error message, it seems like you do not have checkpoints at /proj/cvl/users/x_fahkh/mn/ml-gmpi/ckpts/gmpi_pretrained/20220727_102024290372. Put your checkpoints there with structure:

+-- ckpts
|  +-- gmpi_pretrained
|  |  +-- 20220727_102024290372
|  |  |  +-- config.pth
|  |  |  +-- discriminator.pth
|  |  |  +-- generator.pth
|  |  |  +-- ema.pth
|  |  |  +-- ema2.pth

from ml-gmpi.

VIROBO-15 avatar VIROBO-15 commented on July 19, 2024

Thanking You @Xiaoming-Zhao for replying... I have fixed the issue but still there are some issue which I am not able to figure out

I have trained the model on FFHQ256.
Script :
bash {GMPI_ROOT}/gmpi/eval/eval.sh {GMPI_ROOT} FFHQ256 20220727_102024290372 ${Deep3DFaceRecon_PATH} debug

I have loaded the correct ema.pth file still there is some issue in loading the checkpoints..

Can you please a look at this..

Load weights from /proj/cvl/users/x_fahkh/mn/ml-gmpi/ckpts/gmpi_pretrained/20220727_102024290372/generator.pth

Load weights from /proj/cvl/users/x_fahkh/mn/ml-gmpi/ckpts/gmpi_pretrained/20220727_102024290372/ema.pth

Traceback (most recent call last):
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/prepare_fake_data.py", line 280, in
main(opt)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/prepare_fake_data.py", line 172, in main
generator = setup_model(opt, config, metadata, mpi_xyz_input, mpi_xyz_only_z, vis_mesh=False, device=device)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/common.py", line 144, in setup_model
ema.load_state_dict(ema_state_dict)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_ema/ema.py", line 299, in load_state_dict
"Tried to load_state_dict() with the wrong number of "
ValueError: Tried to load_state_dict() with the wrong number of parameters in the saved state.

Compute FID/KID from
real: /proj/cvl/users/x_fahkh/mn/ml-gmpi/runtime_dataset/real_data/FFHQ256/FFHQ_real_res_256_n_50000
fake: /proj/cvl/users/x_fahkh/mn/ml-gmpi/ckpts/gmpi_pretrained/20220727_102024290372/planes_96_n_50000/psi_1.0/fid_kid/rgb

Creating feature extractor "inception-v3-compat" with features ['2048']
Extracting features from input1
Traceback (most recent call last):
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/compute_fid_kid.py", line 29, in
verbose=True,
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/metrics.py", line 239, in calculate_metrics
featuresdict_1 = extract_featuresdict_from_input_id_cached(1, feat_extractor, **kwargs)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/utils.py", line 372, in extract_featuresdict_from_input_id_cached
featuresdict = fn_recompute()
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/utils.py", line 360, in fn_recompute
return extract_featuresdict_from_input_id(input_id, feat_extractor, **kwargs)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/utils.py", line 342, in extract_featuresdict_from_input_id
input = prepare_input_from_id(input_id, **kwargs)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/utils.py", line 275, in prepare_input_from_id
return prepare_input_from_descriptor(input_desc, **kwargs)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/utils.py", line 255, in prepare_input_from_descriptor
f'Input descriptor "input" field can be either an instance of Dataset, GenerativeModelBase class, or a string, '
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/torch_fidelity/helpers.py", line 9, in vassert
raise ValueError(message)
ValueError: Input descriptor "input" field can be either an instance of Dataset, GenerativeModelBase class, or a string, such as a path to a name of a registered dataset (cifar10-train, cifar10-val, stl10-train, stl10-test, stl10-unlabeled), a directory with file samples, or a path to an ONNX

When I am using the pertained weight the model is performing good and it calculating the FID and KID but when I train the model and use the weights the this error appears.

from ml-gmpi.

Xiaoming-Zhao avatar Xiaoming-Zhao commented on July 19, 2024

@VIROBO-15 Thanks a lot for reporting this issue. I just submitted a commit to fix this. You do not need to re-train the model since the issue only arises in the evaluation code. Hope that helps.

from ml-gmpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.