NVlabs / stylegan3

Official PyTorch implementation of StyleGAN3
Other
6.28k stars 1.1k forks source link

AssertionError: power parameter obsoleted in ImGui 1.78, use imgui.SLIDER_FLAGS_LOGARITHMIC instead #626

Open Bzz2745 opened 7 months ago

Bzz2745 commented 7 months ago

Describe the bug Outputs when I run 'python visualizer.py': Traceback (most recent call last): File "C:\Source\Python\DeepLearning\CV\stylegan3\visualizer.py", line 332, in main() File "C:\ProgramData\miniconda3\envs\universal\lib\site-packages\click\core.py", line 1157, in call return self.main(args, kwargs) File "C:\ProgramData\miniconda3\envs\universal\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\ProgramData\miniconda3\envs\universal\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\ProgramData\miniconda3\envs\universal\lib\site-packages\click\core.py", line 783, in invoke return __callback(args, *kwargs) File "C:\Source\Python\DeepLearning\CV\stylegan3\visualizer.py", line 326, in main viz.draw_frame() File "C:\Source\Python\DeepLearning\CV\stylegan3\visualizer.py", line 126, in draw_frame self.latent_widget(expanded) File "C:\Source\Python\DeepLearning\CV\stylegan3\gui_utils\imgui_utils.py", line 83, in decorator res = method(self, args, **kwargs) File "C:\Source\Python\DeepLearning\CV\stylegan3\viz\latent_widget.py", line 56, in call changed, speed = imgui.slider_float('##speed', self.latent.speed, -5, 5, format='Speed %.3f', power=3) File "imgui\core.pyx", line 9164, in imgui.core.slider_float AssertionError: power parameter obsoleted in ImGui 1.78, use imgui.SLIDER_FLAGS_LOGARITHMIC instead

Expected behavior Just fix this bug caused by the update of imgui.

Desktop (please complete the following information):

Additional context the following link can prevent some info about this update of imgui:

https://github.com/ocornut/imgui/issues/3361

takuphilchan commented 7 months ago

For wsl2 ubuntu 20.04, I removed power=3 and added flags=0 and it worked.

Bzz2745 commented 7 months ago

There is not only one place have used power.Should I change all of them to flag=0 or try one by one ?发自我的手机-------- 原始邮件 --------发件人: Phillip Chananda @.>日期: 2023年11月15日周三 晚上8:07收件人: NVlabs/stylegan3 @.>抄送: Bzz2745 @.>, Author @.>主 题: Re: [NVlabs/stylegan3] AssertionError: power parameter obsoleted in ImGui 1.78, use imgui.SLIDER_FLAGS_LOGARITHMIC instead (Issue #626) For wsl2 ubuntu 20.04, power=3 to flags=0 and it worked.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

takuphilchan commented 7 months ago

email Power is obsolete in imgui 1.78 so you can remove power in both files. The files are located in /eg3d/viz/ for latent_widget.py replace with this changed, speed = imgui.slider_float('##speed', self.latent.speed, -5, 5, format='Speed %.3f', flags=imgui.SLIDER_FLAGS_NONE). for layer_widget.py replace with this _changed, self.fft_beta = imgui.slider_float('##fft_beta', self.fft_beta, min_value=0, max_value=50, format='Kaiser beta %.2f', flags=imgui.SLIDER_FLAGS_NONE). The flags can be used to manage the slider functions behavior . The flags = 0 is for C++ for python you can use imgui.SLIDER_FLAGS_NONE instead of 0 if you want to add flags.

I hope this helps.