IDM-VTON icon indicating copy to clipboard operation
IDM-VTON copied to clipboard

issues in execution

Open hiralU opened this issue 1 year ago • 2 comments

python gradio_demo/app.py An error occurred while trying to fetch yisol/IDM-VTON: yisol/IDM-VTON does not appear to have a file named diffusion_pytorch_model.safetensors. Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead. The config attributes {'decay': 0.9999, 'inv_gamma': 1.0, 'min_decay': 0.0, 'optimization_step': 37000, 'power': 0.6666666666666666, 'update_after_step': 0, 'use_ema_warmup': False} were passed to UNet2DConditionModel, but are not expected and will be ignored. Please verify your config.json configuration file. Some weights of the model checkpoint were not used when initializing UNet2DConditionModel: ['add_embedding.linear_1.bias, add_embedding.linear_1.weight, add_embedding.linear_2.bias, add_embedding.linear_2.weight'] Traceback (most recent call last): File ".\IDM-VTON-main\gradio_demo\app.py", line 95, in parsing_model = Parsing(-1) ^^^^^^^^^^^ File ".\IDM-VTON-main\preprocess\humanparsing\run_parsing.py", line 20, in init self.session = ort.InferenceSession(os.path.join(Path(file).absolute().parents[2].absolute(), 'ckpt/humanparsing/parsing_atr.onnx'), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\anaconda3\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File ".\anaconda3\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 480, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from .\IDM-VTON-main\ckpt/humanparsing/parsing_atr.onnx failed:Protobuf parsing failed.

hiralU avatar Aug 23 '24 06:08 hiralU

model is corrupted use this code to download ckpt.create in root folder:

import os
import requests

# Create the required folder structure
folders = [
    "ckpt/densepose",
    "ckpt/humanparsing",
    "ckpt/openpose/ckpts"
]

for folder in folders:
    os.makedirs(folder, exist_ok=True)

# URLs of the files to be downloaded
files = {
    "ckpt/humanparsing/parsing_atr.onnx": "https://huggingface.co/yisol/IDM-VTON/resolve/main/humanparsing/parsing_atr.onnx",
    "ckpt/humanparsing/parsing_lip.onnx": "https://huggingface.co/yisol/IDM-VTON/resolve/main/humanparsing/parsing_lip.onnx",
    "ckpt/densepose/model_final_162be9.pkl": "https://huggingface.co/yisol/IDM-VTON/resolve/main/densepose/model_final_162be9.pkl",
    "ckpt/openpose/ckpts/body_pose_model.pth": "https://huggingface.co/yisol/IDM-VTON/resolve/main/openpose/ckpts/body_pose_model.pth"
}

# Function to download files
def download_file(url, path):
    response = requests.get(url, stream=True)
    with open(path, 'wb') as file:
        for chunk in response.iter_content(chunk_size=8192):
            if chunk:
                file.write(chunk)
    print(f"Downloaded: {path}")

# Download each file
for path, url in files.items():
    download_file(url, path)

print("Download and folder setup completed successfully.")

faizack avatar Oct 16 '24 22:10 faizack

model is corrupted use this code to download ckpt.create in root folder:

import os import requests

Create the required folder structure

folders = [ "ckpt/densepose", "ckpt/humanparsing", "ckpt/openpose/ckpts" ]

for folder in folders: os.makedirs(folder, exist_ok=True)

URLs of the files to be downloaded

files = { "ckpt/humanparsing/parsing_atr.onnx": "https://huggingface.co/yisol/IDM-VTON/resolve/main/humanparsing/parsing_atr.onnx", "ckpt/humanparsing/parsing_lip.onnx": "https://huggingface.co/yisol/IDM-VTON/resolve/main/humanparsing/parsing_lip.onnx", "ckpt/densepose/model_final_162be9.pkl": "https://huggingface.co/yisol/IDM-VTON/resolve/main/densepose/model_final_162be9.pkl", "ckpt/openpose/ckpts/body_pose_model.pth": "https://huggingface.co/yisol/IDM-VTON/resolve/main/openpose/ckpts/body_pose_model.pth" }

Function to download files

def download_file(url, path): response = requests.get(url, stream=True) with open(path, 'wb') as file: for chunk in response.iter_content(chunk_size=8192): if chunk: file.write(chunk) print(f"Downloaded: {path}")

Download each file

for path, url in files.items(): download_file(url, path)

print("Download and folder setup completed successfully.")

Works for me! Thank you.

mitchell-cheng avatar Mar 22 '25 04:03 mitchell-cheng