Skip to content

Error Convert_Civitai_OpenVINO #2

@homevk15

Description

@homevk15

I tried Convert_Civitai_OpenVINO.py and got many warnings and an error.

D:\Program Files\Python310\lib\site-packages\diffusers\models\unet_2d_condition.py:915: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if dim % default_overall_up_factor != 0:
D:\Program Files\Python310\lib\site-packages\diffusers\models\downsampling.py:135: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
assert hidden_states.shape[1] == self.channels
D:\Program Files\Python310\lib\site-packages\diffusers\models\downsampling.py:144: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
assert hidden_states.shape[1] == self.channels
D:\Program Files\Python310\lib\site-packages\diffusers\models\upsampling.py:149: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
assert hidden_states.shape[1] == self.channels
D:\Program Files\Python310\lib\site-packages\diffusers\models\upsampling.py:165: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if hidden_states.shape[0] >= 64:
D:\Program Files\Python310\lib\site-packages\diffusers\models\unet_2d_condition.py:1206: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if not return_dict:
Unet successfully converted to ONNX
Traceback (most recent call last):
File "D:\astable-diffusion\openvino_notebooks\notebooks\225-stable-diffusion-text-to-image\t5\civitai.py", line 87, in
model = mo.convert_model(UNET_ONNX_PATH, compress_to_fp16=True)
File "D:\Program Files\Python310\lib\site-packages\openvino\tools\mo\convert.py", line 364, in convert_model
ov_model, _ = _convert(cli_parser, framework, params, True)
File "D:\Program Files\Python310\lib\site-packages\openvino\tools\mo\convert_impl.py", line 957, in _convert
raise e.with_traceback(None)
RuntimeError: Check 'false' failed at src\frontends\common\src\frontend.cpp:54:
Converting input model
bad allocation

torch: 2.1.2+cpu
onnx: 1.15.0
onnxruntime: 1.16.3
tensorflow-intel: 2.14.0
Intel Core i5-6500 CPU

I found openvinotoolkit/openvino#12747 that tensorflow-intel >=2.8.0 will cause unexpected error.
I tried to downgrade tensorflow-intel to a version tensorflow-intel==2.8.0, but it asked me to downgrade other packages like
Other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Since you made it working, could you create virtualenv with needed packages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions