Bismuth-Consultancy-BV / MLOPs

Machine Learning Toolset for Houdini
BSD 3-Clause "New" or "Revised" License
359 stars 53 forks source link

MLOPS Download models error on Mac M2 #151

Open polhol opened 2 months ago

polhol commented 2 months ago

Would really love to get MLOPS working on my Mac M2 Studio but

MLOPS_download_model_error

I'm getting this error when trying to download the models:

"Traceback (most recent call last): File "/Users/pabloholcer/Documents/GITHUB/MLOPs/scripts/python/mlops_utils.py", line 453, in on_accept ensure_huggingface_model_local(model_name, download_dir, model_type=model_type) File "/Users/pabloholcer/Documents/GITHUB/MLOPs/scripts/python/mlops_utils.py", line 315, in ensure_huggingface_model_local from sdpipeline import pipelines_lookup File "/Applications/Houdini/Houdini20.0.625/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages-forced/shiboken2/files.dir/shibo kensupport/feature.py", line 142, in _import return original_import(name, *args, *kwargs) File "/Users/pabloholcer/Documents/GITHUB/MLOPs/scripts/python/sdpipeline/pipelines_lookup.py", line 1, in from diffusers import ( File "/Applications/Houdini/Houdini20.0.625/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages-forced/shiboken2/files.dir/shibo kensupport/feature.py", line 142, in _import return original_import(name, args, **kwargs) ModuleNotFoundError: No module named 'diffusers'"

polhol commented 2 months ago

Ok I should add that when installing the dependencies I've got this error:

Traceback (most recent call last): File "mlops_install", line 5, in File "/Users/pabloholcer/Documents/GITHUB/MLOPs/scripts/python/mlops_utils.py", line 125, in install_mlops_dependencies pip_install(hou.text.expandString("$MLOPS/requirements.txt"), True, True) File "/Users/pabloholcer/Documents/GITHUB/MLOPs/scripts/python/mlops_utils.py", line 433, in pip_install raise hou.Error(res[1].decode()) hou.Error: /Users/pabloholcer/Documents/GITHUB/MLOPs/data/dependencies/python/_distutils_hack/init.py:26: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") Running command git clone --filter=blob:none --quiet https://github.com/mattloper/chumpy /private/var/folders/75/4_1_kb794h9_6y494h4prfm00000gn/T/pip-install-c1l_47kd/chumpy_1556f5b67c3f4fb7a629ec7ffec6ed50 Running command git rev-parse -q --verify 'sha^51d5afd92a8ded3637553be8cef41f328a1c863a' Running command git fetch -q https://github.com/mattloper/chumpy 51d5afd92a8ded3637553be8cef41f328a1c863a error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/private/var/folders/75/4_1_kb794h9_6y494h4prfm00000gn/T/pip-install-c1l_47kd/xformers_cba0e58f5bbb4762b90c6fb346c3c719/setup.py", line 23, in import torch File "/Applications/Houdini/Houdini20.0.688/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages-forced/shiboken2/files.dir/shibokensupport/feature.py", line 142, in _import return original_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'torch' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

madsrune commented 1 month ago

@polhol Also on Mac, I got past the "No module name 'torch'" error by manually installing torch inside Houdini's python environment. I followed the instructions to set up pip inside Houdini here (adjusting windows paths to macos style): https://www.youtube.com/watch?v=cIEN50WuPoc, then installed torch. "Install Dependencies" was now able to continue ... until:

Traceback (most recent call last): File "mlops_install", line 5, in File "/Users/-/Documents/github/MLOPs/scripts/python/mlops_utils.py", line 125, in install_mlops_dependencies pip_install(hou.text.expandString("$MLOPS/requirements.txt"), True, True) File "/Users/-/Documents/github/MLOPs/scripts/python/mlops_utils.py", line 433, in pip_install raise hou.Error(res[1].decode()) hou.Error: /Users/-/Documents/github/MLOPs/data/dependencies/python/_distutils_hack/init.py:26: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") Running command git clone --filter=blob:none --quiet https://github.com/mattloper/chumpy /private/var/folders/t7/h75np9zx0jb02xfmp1y87wfc0000gn/T/pip-install-0r27judo/chumpy_202d821a021d4a2287f7c59a0c048b70 Running command git rev-parse -q --verify 'sha^51d5afd92a8ded3637553be8cef41f328a1c863a' Running command git fetch -q https://github.com/mattloper/chumpy 51d5afd92a8ded3637553be8cef41f328a1c863a ERROR: Ignored the following versions that require a different python version: 0.52.0 Requires-Python >=3.6,<3.9; 0.52.0rc3 Requires-Python >=3.6,<3.9; 0.53.0 Requires-Python >=3.6,<3.10; 0.53.0rc1.post1 Requires-Python >=3.6,<3.10; 0.53.0rc2 Requires-Python >=3.6,<3.10; 0.53.0rc3 Requires-Python >=3.6,<3.10; 0.53.1 Requires-Python >=3.6,<3.10; 0.54.0 Requires-Python >=3.7,<3.10; 0.54.0rc2 Requires-Python >=3.7,<3.10; 0.54.0rc3 Requires-Python >=3.7,<3.10; 0.54.1 Requires-Python >=3.7,<3.10; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10 ERROR: Could not find a version that satisfies the requirement onnxruntime-gpu; extra == "gpu" (from rembg[gpu]) (from versions: none) ERROR: No matching distribution found for onnxruntime-gpu; extra == "gpu"