-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error occurred when executing ReActorFaceSwap: Input type (torch.FloatTensor) and weight type (PrivateUse1FloatType) should be the same or input should be a MKLDNN tensor and weight is a dense tensor #76
Comments
Only one version of ORT must be installed in one environment
Almost the same here And about |
Unfortunately I have an AMD based machine - so I need directml. I cannot run just onnxruntime |
Why not? ORT works with every platform, it uses CPUExecutionProvider And as I said above, you have 3 versions of ORT installed at the same time - it's not right. ORT won't be able to work properly. Only one version must be installed. |
torch-directml gives me the speed of my GPU and utilises the VRam better. This is the recommended install by Comfyui for AMD based machines. And it really does make a difference - I've tested it. What I don't understand (and this isn't your fault) is why Pytorch isn't using ROCm for windows. ROCm is up to 5.7.1 on Windows, but Pytorch simply doesn't use it - only the Linux version. This would solve everything. |
Right - I did what you suggested, and collated all the nodes "requirement" into one file - removed all the old ones and just installed the nessasery requirements making sure there are no multiple versions. I sill had to install torch-directml because ComfyUI simply does not work without it. Yes I tried onnxruntime CPU only and it does not work. I still get the same errors as above. As a note, I removed all onnxruntime and onnx, but when I installed torch-directml (as its an AMD requirement) it installed : onnx 1.15.0
onnxruntime 1.16.1
onnxruntime-directml 1.16.1 As dependencies. So yeaaaa, 3 Onnx runtimes. Pip list: PS C:\Users\lethris> pip list
WARNING: Ignoring invalid distribution -rotobuf (d:\apps\python\python310\lib\site-packages)
Package Version
---------------------------- ------------------
absl-py 1.4.0
accelerate 0.24.1
addict 2.4.0
aiofiles 23.2.1
aiohttp 3.8.6
aiosignal 1.3.1
albumentations 1.3.1
aliyun-python-sdk-core 2.13.36
aliyun-python-sdk-kms 2.16.1
altair 5.1.1
annotated-types 0.5.0
antlr4-python3-runtime 4.9.3
anyio 3.7.1
asgiref 3.7.2
astunparse 1.6.3
async-timeout 4.0.2
asyncer 0.0.2
attrs 23.1.0
basicsr 1.4.2
beautifulsoup4 4.12.2
boltons 23.0.0
boto3 1.28.44
botocore 1.31.44
cachetools 5.3.1
certifi 2023.7.22
cffi 1.15.1
chardet 3.0.4
charset-normalizer 3.2.0
click 8.1.6
cmake 3.27.7
colorama 0.4.6
coloredlogs 15.0.1
compel 2.0.2
contourpy 1.1.0
controlnet-aux 0.0.7
crcmod 1.7
cryptography 41.0.3
cssselect2 0.7.0
cstr 0.1.0
cycler 0.11.0
Cython 3.0.5
deep-translator 1.11.4
diffusers 0.22.0.dev0
Django 4.2.4
dynamicprompts 0.29.0
easydict 1.10
einops 0.7.0
exceptiongroup 1.1.3
facexlib 0.3.0
fairscale 0.4.13
fastapi 0.103.1
ffmpeg 1.4
ffmpy 0.3.0
filelock 3.13.1
filetype 1.2.0
filterpy 1.4.5
flatbuffers 23.5.26
fonttools 4.42.0
frozenlist 1.4.0
fsspec 2023.6.0
ftfy 6.1.1
future 0.18.3
fvcore 0.1.5.post20221221
gast 0.4.0
gdown 4.7.1
gfpgan 1.3.8
gitdb 4.0.10
GitPython 3.1.40
google-auth 2.22.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
googletrans 3.1.0a0
gradio 3.42.0
gradio_client 0.5.0
grpcio 1.56.2
h11 0.9.0
h2 3.2.0
h5py 3.9.0
hpack 3.0.0
hstspreload 2023.1.1
httpcore 0.9.1
httpx 0.13.3
huggingface-hub 0.17.3
humanfriendly 10.0
hyperframe 5.2.0
idna 2.10
image 1.5.33
imageio 2.31.6
imageio-ffmpeg 0.4.9
img2texture 1.0.6
importlib-metadata 6.8.0
importlib-resources 6.0.1
insightface 0.7.3
iopath 0.1.10
Jinja2 3.1.2
jmespath 0.10.0
joblib 1.3.2
jsonschema 4.19.0
jsonschema-specifications 2023.7.1
keras 2.10.0
Keras-Preprocessing 1.1.2
kiwisolver 1.4.4
lark 1.1.7
lazy_loader 0.3
libclang 16.0.6
llvmlite 0.41.1
lmdb 1.4.1
lxml 4.9.3
Markdown 3.4.4
markdown-it-py 3.0.0
MarkupSafe 2.1.3
matplotlib 3.8.0
mdurl 0.1.2
mediapipe 0.10.7
mmcv 2.0.0
mmdet 3.0.0
mmengine 0.7.4
model-index 0.1.11
mpmath 1.3.0
multidict 6.0.4
networkx 3.1
numba 0.58.1
numexpr 2.8.7
numpy 1.26.1
oauthlib 3.2.2
omegaconf 2.3.0
onnx 1.15.0
onnxruntime 1.16.1
onnxruntime-directml 1.16.1
openai 0.27.8
opencv-contrib-python 4.8.1.78
opencv-python 4.8.1.78
opendatalab 0.0.9
openmim 0.3.9
openxlab 0.0.17
opt-einsum 3.3.0
ordered-set 4.1.0
orjson 3.9.5
oss2 2.17.0
packaging 23.1
pandas 2.1.2
piexif 1.1.3
pilgram 1.2.1
Pillow 9.5.0
pip 23.2.1
platformdirs 3.10.0
pooch 1.7.0
portalocker 2.7.0
prettytable 3.6.0
protobuf 3.20.3
psutil 5.9.6
py-cpuinfo 9.0.0
pyasn1 0.5.0
pyasn1-modules 0.3.0
pycocoevalcap 1.2
pycocotools 2.0.6
pycparser 2.21
pycryptodome 3.18.0
pydantic 2.3.0
pydantic_core 2.6.3
pydub 0.25.1
pygit2 1.12.2
Pygments 2.15.1
PyMatting 1.1.8
pyparsing 3.0.9
pypng 0.20220715.0
pyreadline3 3.4.1
PySocks 1.7.1
python-dateutil 2.8.2
python-multipart 0.0.6
pytz 2023.3
PyWavelets 1.4.1
pywin32 306
PyYAML 6.0.1
pyzbar 0.1.9
qrcode 7.4.2
qudida 0.0.4
referencing 0.30.2
regex 2023.6.3
rembg 2.0.52
reportlab 4.0.4
requests 2.28.2
requests-oauthlib 1.3.1
requirements-parser 0.5.0
rfc3986 1.5.0
rich 13.6.0
rich-argparse 1.4.0
rpds-py 0.10.2
rsa 4.9
s3transfer 0.6.2
safetensors 0.4.0
scikit-image 0.22.0
scikit-learn 1.3.2
scipy 1.11.3
seaborn 0.12.2
segment-anything 1.0
semantic-version 2.10.0
setuptools 60.2.0
shapely 2.0.1
simpleeval 0.9.13
simplejson 3.19.1
six 1.16.0
smmap 5.0.0
sniffio 1.3.0
sounddevice 0.4.6
soupsieve 2.4.1
sqlparse 0.4.4
starlette 0.27.0
svglib 1.5.1
sympy 1.12
tabulate 0.9.0
tb-nightly 2.12.0a20230126
tensorboard 2.10.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.10.1
tensorflow-cpu 2.10.0
tensorflow-directml-plugin 0.4.0.dev230202
tensorflow-estimator 2.10.0
tensorflow_intel 2.10.0
tensorflow-io-gcs-filesystem 0.31.0
termcolor 2.3.0
terminaltables 3.1.10
threadpoolctl 3.2.0
tifffile 2023.7.18
timm 0.9.8
tinycss2 1.2.1
tokenizers 0.14.1
tomli 2.0.1
toolz 0.12.0
torch 2.0.0
torch-directml 0.2.0.dev230426
torchaudio 2.0.0
torchsde 0.2.6
torchvision 0.15.1
tqdm 4.66.1
trampoline 0.1.2
transformers 4.34.1
types-setuptools 68.1.0.0
typing_extensions 4.7.1
tzdata 2023.3
ultralytics 8.0.147
urllib3 1.26.16
uvicorn 0.23.2
watchdog 3.0.0
wcwidth 0.2.6
webencodings 0.5.1
websockets 11.0.3
Werkzeug 2.3.6
wheel 0.41.2
wrapt 1.15.0
yacs 0.1.8
yapf 0.40.2
yarl 1.9.2
zipp 3.16.2 |
After much playing about. it ONLY works for me with this Specific Condition: No other "swap_models" or "face_restore_models" will work. I am happy to use this for now, as it it somewhat better than it was before :) Edit: Spoke to soon - It's stopped working again :( Error occurred when executing ReActorFaceSwap:
Input type (torch.FloatTensor) and weight type (PrivateUse1FloatType) should be the same or input should be a MKLDNN tensor and weight is a dense tensor 15:56:37 - ReActor Node - STATUS - Working: source face index [0], target face index [0]
15:56:37 - ReActor Node - INFO - Source Image MD5 Hash = add6bcd76dfbbd4449e32bb7c008b34d
15:56:37 - ReActor Node - INFO - Source Image the Same? True
15:56:37 - ReActor Node - STATUS - Using Ready Source Face(s) Model...
15:56:37 - ReActor Node - INFO - Target Image MD5 Hash = 8a153c904aee6ddef74c8be34540a371
15:56:37 - ReActor Node - INFO - Target Image the Same? True
15:56:37 - ReActor Node - STATUS - Using Ready Target Face(s) Model...
15:56:37 - ReActor Node - STATUS - Source Face 0: Detected Gender -F-
15:56:37 - ReActor Node - STATUS - OK - Detected Gender matches Condition
15:56:37 - ReActor Node - STATUS - Target Face 0: Detected Gender -F-
15:56:37 - ReActor Node - STATUS - OK - Detected Gender matches Condition
ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\apps\SD-WebUI\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 134, in execute
self.face_helper.get_face_landmarks_5(only_center_face=False, resize=640, eye_dist_threshold=5)
File "E:\ASSETS\AI-TOOLS\COMFY-DATA\custom_nodes\comfyui-reactor-node\r_facelib\utils\face_restoration_helper.py", line 151, in get_face_landmarks_5
bboxes = self.face_det.detect_faces(input_img)
File "E:\ASSETS\AI-TOOLS\COMFY-DATA\custom_nodes\comfyui-reactor-node\r_facelib\detection\retinaface\retinaface.py", line 215, in detect_faces
loc, conf, landmarks, priors = self.__detect_faces(image)
File "E:\ASSETS\AI-TOOLS\COMFY-DATA\custom_nodes\comfyui-reactor-node\r_facelib\detection\retinaface\retinaface.py", line 162, in __detect_faces
loc, conf, landmarks = self(inputs)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\ASSETS\AI-TOOLS\COMFY-DATA\custom_nodes\comfyui-reactor-node\r_facelib\detection\retinaface\retinaface.py", line 127, in forward
out = self.body(inputs)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\apps\Python\Python310\lib\site-packages\torchvision\models\_utils.py", line 69, in forward
x = module(x)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
input = module(input)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
input = module(input)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "D:\apps\Python\Python310\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (torch.FloatTensor) and weight type (PrivateUse1FloatType) should be the same or input should be a MKLDNN tensor and weight is a dense tensor |
Should work now |
First, confirm
What happened?
I am having the same issue as this, only I'm using ComfyUI -> #40 (comment)
However, the solution "deleting torch and torchvision from the requirements" did not work for me.
I have tried with the following Models:
These all work with Roop. But I have since removed Roop in favour of ReActor (as roop development has stopped)
ReActor only works as expected if I use "Face_Restore_Model = None", but obviously the quality is naff.
Error Message is:
Steps to reproduce the problem
Your workflow
Sysinfo
Relevant console log
Additional information
PIP Packages:
Package Version
absl-py 1.4.0
accelerate 0.21.0
addict 2.4.0
aiofiles 23.2.1
aiohttp 3.8.5
aiosignal 1.3.1
albumentations 1.3.1
aliyun-python-sdk-core 2.13.36
aliyun-python-sdk-kms 2.16.1
altair 5.1.1
annotated-types 0.5.0
antlr4-python3-runtime 4.9.3
anyio 3.7.1
asgiref 3.7.2
astunparse 1.6.3
async-timeout 4.0.2
asyncer 0.0.2
attrs 23.1.0
basicsr 1.4.2
beautifulsoup4 4.12.2
boltons 23.0.0
boto3 1.28.44
botocore 1.31.44
cachetools 5.3.1
certifi 2023.7.22
cffi 1.15.1
chardet 3.0.4
charset-normalizer 3.2.0
click 8.1.6
cmake 3.27.0
colorama 0.4.6
coloredlogs 15.0.1
compel 2.0.2
contourpy 1.1.0
controlnet-aux 0.0.7
crcmod 1.7
cryptography 41.0.3
cssselect2 0.7.0
cstr 0.0.1
cycler 0.11.0
Cython 3.0.0
deep-translator 1.11.4
diffusers 0.22.0.dev0
Django 4.2.4
dynamicprompts 0.29.0
easydict 1.10
einops 0.6.1
exceptiongroup 1.1.3
facexlib 0.3.0
fairscale 0.4.4
fastapi 0.103.1
ffmpeg 1.4
ffmpy 0.3.0
filelock 3.12.2
filetype 1.2.0
filterpy 1.4.5
flatbuffers 23.5.26
fonttools 4.42.0
frozenlist 1.4.0
fsspec 2023.6.0
ftfy 6.1.1
future 0.18.3
fvcore 0.1.5.post20221221
gast 0.4.0
gdown 4.7.1
gfpgan 1.3.8
gitdb 4.0.10
GitPython 3.1.32
google-auth 2.22.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
googletrans 3.1.0a0
gradio 3.42.0
gradio_client 0.5.0
grpcio 1.56.2
h11 0.9.0
h2 3.2.0
h5py 3.9.0
hpack 3.0.0
hstspreload 2023.1.1
httpcore 0.9.1
httpx 0.13.3
huggingface-hub 0.16.4
humanfriendly 10.0
hyperframe 5.2.0
idna 2.10
image 1.5.33
imageio 2.31.1
imageio-ffmpeg 0.4.9
img2texture 1.0.6
importlib-metadata 6.8.0
importlib-resources 6.0.1
insightface 0.7.3
iopath 0.1.10
Jinja2 3.1.2
jmespath 0.10.0
joblib 1.3.1
jsonschema 4.19.0
jsonschema-specifications 2023.7.1
keras 2.10.0
Keras-Preprocessing 1.1.2
kiwisolver 1.4.4
lark 1.1.7
lazy_loader 0.3
libclang 16.0.6
llvmlite 0.40.1
lmdb 1.4.1
lxml 4.9.3
Markdown 3.4.4
markdown-it-py 3.0.0
MarkupSafe 2.1.3
matplotlib 3.7.2
mdurl 0.1.2
mediapipe 0.10.3
mmcv 2.0.0
mmdet 3.0.0
mmengine 0.7.4
model-index 0.1.11
mpmath 1.3.0
multidict 6.0.4
networkx 3.1
numba 0.57.1
numexpr 2.8.4
numpy 1.23.5
oauthlib 3.2.2
omegaconf 2.3.0
onnx 1.14.0
onnxruntime 1.16.1
onnxruntime-directml 1.16.0
onnxruntime-gpu 1.15.1
openai 0.27.8
opencv-contrib-python 4.8.0.74
opencv-python 4.8.0.76
opencv-python-headless 4.7.0.72
opendatalab 0.0.10
openmim 0.3.9
openxlab 0.0.17
opt-einsum 3.3.0
ordered-set 4.1.0
orjson 3.9.5
oss2 2.17.0
packaging 23.1
pandas 2.0.3
piexif 1.1.3
pilgram 1.2.1
Pillow 9.5.0
pip 23.2.1
platformdirs 3.10.0
pooch 1.7.0
portalocker 2.7.0
prettytable 3.6.0
protobuf 3.20.3
psutil 5.9.5
py-cpuinfo 9.0.0
pyasn1 0.5.0
pyasn1-modules 0.3.0
pycocoevalcap 1.2
pycocotools 2.0.6
pycparser 2.21
pycryptodome 3.18.0
pydantic 2.3.0
pydantic_core 2.6.3
pydub 0.25.1
pygit2 1.12.2
Pygments 2.15.1
PyMatting 1.1.8
pyparsing 3.0.9
pypng 0.20220715.0
pyreadline3 3.4.1
PySocks 1.7.1
python-dateutil 2.8.2
python-multipart 0.0.6
pytz 2023.3
PyWavelets 1.4.1
pywin32 306
PyYAML 6.0.1
pyzbar 0.1.9
qrcode 7.4.2
qudida 0.0.4
referencing 0.30.2
regex 2023.6.3
rembg 2.0.50
reportlab 4.0.4
requests 2.28.2
requests-oauthlib 1.3.1
requirements-parser 0.5.0
rfc3986 1.5.0
rich 13.4.2
rich-argparse 1.3.0
rpds-py 0.10.2
rsa 4.9
s3transfer 0.6.2
safetensors 0.3.1
scikit-image 0.20.0
scikit-learn 1.3.0
scipy 1.11.1
seaborn 0.12.2
segment-anything 1.0
semantic-version 2.10.0
setuptools 60.2.0
shapely 2.0.1
simpleeval 0.9.13
simplejson 3.19.1
six 1.16.0
smmap 5.0.0
sniffio 1.3.0
sounddevice 0.4.6
soupsieve 2.4.1
sqlparse 0.4.4
starlette 0.27.0
svglib 1.5.1
sympy 1.12
tabulate 0.9.0
tb-nightly 2.12.0a20230126
tensorboard 2.10.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.10.1
tensorflow-cpu 2.10.0
tensorflow-directml-plugin 0.4.0.dev230202
tensorflow-estimator 2.10.0
tensorflow_intel 2.10.0
tensorflow-io-gcs-filesystem 0.31.0
termcolor 2.3.0
terminaltables 3.1.10
threadpoolctl 3.2.0
tifffile 2023.7.18
timm 0.6.13
tinycss2 1.2.1
tokenizers 0.13.3
tomli 2.0.1
toolz 0.12.0
torch 2.0.0
torch-directml 0.2.0.dev230426
torchsde 0.2.5
torchvision 0.15.1
tqdm 4.65.0
trampoline 0.1.2
transformers 4.26.1
types-setuptools 68.1.0.0
typing_extensions 4.7.1
tzdata 2023.3
ultralytics 8.0.147
urllib3 1.26.16
uvicorn 0.23.2
watchdog 3.0.0
wcwidth 0.2.6
webencodings 0.5.1
websockets 11.0.3
Werkzeug 2.3.6
wheel 0.41.2
wrapt 1.15.0
yacs 0.1.8
yapf 0.40.1
yarl 1.9.2
zipp 3.16.2
The text was updated successfully, but these errors were encountered: