mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
318 stars 101 forks source link

OpenGL.error.NullFunctionError / GlutInit Problem #111

Open lukas735 opened 10 months ago

lukas735 commented 10 months ago

I have a problem if i run the script for downloading_trained_model.sh. GPT suggested to download the Model Manuelly... But after i had in next step even more problems this seemed to be not a good practice.

sh ./scripts/download_trained_model.sh

Because after that my Running of demo had this error:

sh ./scripts/demo.sh Resuming from ./checkpoints/pifuhd.pt Warning: opt is overwritten. test data size: 1 initialize network with normal initialize network with normal generate mesh (test) ... 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Mein-Computer\Projekte\pifuhd\apps\simple_test.py", line 30, in reconWrapper(cmd, args.use_rect) File "C:\Mein-Computer\Projekte\pifuhd\apps\recon.py", line 220, in reconWrapper recon(opt, use_rect) File "C:\Mein-Computer\Projekte\pifuhd\apps\recon.py", line 205, in recon test_data = test_dataset[i] File "C:\Mein-Computer\Projekte\pifuhd\lib\data\EvalWPoseDataset.py", line 282, in getitem return self.get_item(index) File "C:\Mein-Computer\Projekte\pifuhd\lib\data\EvalWPoseDataset.py", line 242, in get_item rect = self.crop_func(keypoints) File "C:\Mein-Computer\Projekte\pifuhd\lib\data\EvalWPoseDataset.py", line 125, in fullbody_crop center = (0.5 * (pmax[:2] + pmin[:2])).astype(numpy.int) NameError: name 'numpy' is not defined Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Mein-Computer\Projekte\pifuhd\apps\render_turntable.py", line 69, in renderer = ColorRender(width=args.width, height=args.height) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\color_render.py", line 34, in init CamRender.init(self, width, height, name, program_files=program_files) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\cam_render.py", line 32, in init Render.init(self, width, height, name, program_files, color_size, ms_rate) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\render.py", line 41, in init glutInit() File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit _base_glutInit( ctypes.byref(count), holder ) File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\platform\baseplatform.py", line 423, in call raise error.NullFunctionError( OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

ChatGPT recognized tat this numpy is not defined error comes because in some scripts is np.int used. Its deprecated and int is the working one so i changed in the script all this np.int and np.bool and removed the np. . After that it seemed to run a bit further... but still has errors... What is the matter... Shouldn't this package run with the dependencies it installs?

sh ./scripts/demo.sh Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Mein-Computer\Projekte\pifuhd\apps\simple_test.py", line 4, in from .recon import reconWrapper File "C:\Mein-Computer\Projekte\pifuhd\apps\recon.py", line 18, in import matplotlib.pyplot as plt ModuleNotFoundError: No module named 'matplotlib' Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Mein-Computer\Projekte\pifuhd\apps\render_turntable.py", line 69, in renderer = ColorRender(width=args.width, height=args.height) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\color_render.py", line 34, in init CamRender.init(self, width, height, name, program_files=program_files) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\cam_render.py", line 32, in init Render.init(self, width, height, name, program_files, color_size, ms_rate) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\render.py", line 41, in init glutInit() File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit _base_glutInit( ctypes.byref(count), holder ) File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\platform\baseplatform.py", line 423, in call raise error.NullFunctionError( OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

C:\Mein-Computer\Projekte\pifuhd(main -> origin) λ pip install 'matplotlib' ERROR: Invalid requirement: "'matplotlib'"

C:\Mein-Computer\Projekte\pifuhd(main -> origin) λ pip install matplotlib Collecting matplotlib Downloading matplotlib-3.8.2-cp310-cp310-win_amd64.whl.metadata (5.9 kB) Collecting contourpy>=1.0.1 (from matplotlib) Downloading contourpy-1.2.0-cp310-cp310-win_amd64.whl.metadata (5.8 kB) Collecting cycler>=0.10 (from matplotlib) Downloading cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB) Collecting fonttools>=4.22.0 (from matplotlib) Downloading fonttools-4.46.0-cp310-cp310-win_amd64.whl.metadata (159 kB) ---------------------------------------- 159.4/159.4 kB 867.2 kB/s eta 0:00:00 Collecting kiwisolver>=1.3.1 (from matplotlib) Downloading kiwisolver-1.4.5-cp310-cp310-win_amd64.whl.metadata (6.5 kB) Requirement already satisfied: numpy<2,>=1.21 in c:\users\lukas\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (1.26.2) Requirement already satisfied: packaging>=20.0 in c:\users\lukas\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (23.2) Requirement already satisfied: pillow>=8 in c:\users\lukas\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (10.1.0) Collecting pyparsing>=2.3.1 (from matplotlib) Downloading pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB) Collecting python-dateutil>=2.7 (from matplotlib) Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) ---------------------------------------- 247.7/247.7 kB 949.8 kB/s eta 0:00:00 Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib) Downloading six-1.16.0-py2.py3-none-any.whl (11 kB) Downloading matplotlib-3.8.2-cp310-cp310-win_amd64.whl (7.6 MB) ---------------------------------------- 7.6/7.6 MB 939.5 kB/s eta 0:00:00 Downloading contourpy-1.2.0-cp310-cp310-win_amd64.whl (186 kB) ---------------------------------------- 186.7/186.7 kB 1.6 MB/s eta 0:00:00 Downloading cycler-0.12.1-py3-none-any.whl (8.3 kB) Downloading fonttools-4.46.0-cp310-cp310-win_amd64.whl (2.2 MB) ---------------------------------------- 2.2/2.2 MB 877.3 kB/s eta 0:00:00 Downloading kiwisolver-1.4.5-cp310-cp310-win_amd64.whl (56 kB) ---------------------------------------- 56.1/56.1 kB 420.7 kB/s eta 0:00:00 Downloading pyparsing-3.1.1-py3-none-any.whl (103 kB) ---------------------------------------- 103.1/103.1 kB 743.2 kB/s eta 0:00:00 Installing collected packages: six, pyparsing, kiwisolver, fonttools, cycler, contourpy, python-dateutil, matplotlib Successfully installed contourpy-1.2.0 cycler-0.12.1 fonttools-4.46.0 kiwisolver-1.4.5 matplotlib-3.8.2 pyparsing-3.1.1 python-dateutil-2.8.2 six-1.16.0

C:\Mein-Computer\Projekte\pifuhd(main -> origin) λ sh ./scripts/demo.sh Resuming from ./checkpoints/pifuhd.pt Warning: opt is overwritten. test data size: 1 initialize network with normal initialize network with normal generate mesh (test) ... 0%| | 0/1 [00:00<?, ?it/s]./results/pifuhd_final/recon/result_test_256.obj 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:33<00:00, 33.76s/it] Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Mein-Computer\Projekte\pifuhd\apps\render_turntable.py", line 69, in renderer = ColorRender(width=args.width, height=args.height) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\color_render.py", line 34, in init CamRender.init(self, width, height, name, program_files=program_files) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\cam_render.py", line 32, in init Render.init(self, width, height, name, program_files, color_size, ms_rate) File "C:\Mein-Computer\Projekte\pifuhd\lib\render\gl\render.py", line 41, in init glutInit() File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit _base_glutInit( ctypes.byref(count), holder ) File "C:\Users\lukas\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\platform\baseplatform.py", line 423, in call raise error.NullFunctionError( OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

My guess is that its maybe a problem of the wrong version of torch... he has installed automatically newest version but in readme the version 1.5.0 is mentioned. I guessed that maybe the readme is outdated.But unfortunetely this doesn't solve the matter. I hope you can help. I use windows.