HugoTini / DeepBump

Normal & height maps generation from single pictures
https://hugotini.github.io/deepbump
GNU General Public License v3.0
1.02k stars 36 forks source link

Cannot generate normal map #32

Open Jooj3D opened 9 months ago

Jooj3D commented 9 months ago

hi all, i got this problem:

Python: Traceback (most recent call last):
  File "C:\Users\giosu\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\DeepBump-master\__init__.py", line 162, in execute
    output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print)
  File "C:\Users\giosu\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\DeepBump-master\module_color_to_normals.py", line 36, in apply
    ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 432, in __init__
    raise e
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 451, in _create_inference_session
    raise ValueError(
ValueError: This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)

i installed the addon on windows 11 blender version 3.6 i installed the dependencies but the addon give me this error whenever i try to create a normal map

00004707 commented 9 months ago

I'm not familiar with the ORT library that this addon uses, but changing the 36 line in module_color_to_normals.py file from

ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")

to

ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx", providers=['CPUExecutionProvider'])

allows the addon to generate normal maps. Still, the addon requires an update and confirmation from the developer if this is the correct solution.

BrynnaDaRosa commented 9 months ago

had same issue. changed line 36 and it generated a normal map as expected. hope developer responds.

1790374044 commented 9 months ago

Maybe it is related to onnxruntime? See https://github.com/microsoft/onnxruntime/issues/17631 , which was introduced in the 1.16.0 release.

Maitrihamburg commented 9 months ago

Had the same issue, fixed it with the code provided by "00004707". For anyone wondering where to find the python script:

Usually its under "AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\"