Error Installing Dependencies for Magic123 on Google Colab #51

Open
opened 2024-04-20 17:12:05 +08:00 by RoenTh · 3 comments
RoenTh commented 2024-04-20 17:12:05 +08:00 (Migrated from github.com)

I am trying to run the Magic123 model in a Google Colab, but I am encountering installation errors for several packages (raymarching, shencoder, freqencoder, and gridencoder). The installation fails during the execution of install.sh, with the following error for each package

Installing collected packages: raymarching
error: subprocess-exited-with-error

× Running setup.py install for raymarching did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Running setup.py install for raymarching ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> raymarching

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure."

And when tryingto install them with pip setup.py install i get this error:

install_log.log

Edit: I found someone's work on the Internet, trying Magic123 in GooleColab like me, but when I compile this notebook, I get the same error as well. They didnt seem to have this error when the notebook was created.

Any tips or advice on resolving this issue would be greatly appreciated. Thank you in advance for your help!

I am trying to run the Magic123 model in a Google Colab, but I am encountering installation errors for several packages (raymarching, shencoder, freqencoder, and gridencoder). The installation fails during the execution of install.sh, with the following error for each package ``` Installing collected packages: raymarching error: subprocess-exited-with-error × Running setup.py install for raymarching did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. Running setup.py install for raymarching ... error error: legacy-install-failure × Encountered error while trying to install package. ╰─> raymarching note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure." ``` And when tryingto install them with pip setup.py install i get this error: [install_log.log](https://github.com/guochengqian/Magic123/files/15047558/install_log.log) Edit: I found someone's [work](https://colab.research.google.com/drive/1efRK0qhmb6emV3FPpuDvNizIpQVOBqFp?usp=sharing) on the Internet, trying Magic123 in GooleColab like me, but when I compile this notebook, I get the same error as well. They didnt seem to have this error when the notebook was created. Any tips or advice on resolving this issue would be greatly appreciated. Thank you in advance for your help!
MoeenArif1 commented 2024-06-01 22:27:39 +08:00 (Migrated from github.com)

any update?

any update?
MoeenArif1 commented 2024-06-02 05:10:47 +08:00 (Migrated from github.com)

Found the solution, the problem is related c++14 not working on google colab.
To solve the issue change c++14 to c++17 in setup.py of raymarching, shencoder, freqencoder. it should look like this:
import os
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

_src_path = os.path.dirname(os.path.abspath(file))

nvcc_flags = [
'-O3', '-std=c++17',
'-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__',
'-use_fast_math'
]

if os.name == "posix":
c_flags = ['-O3', '-std=c++17']
elif os.name == "nt":
c_flags = ['/O2', '/std:c++17']
.........

Found the solution, the problem is related c++14 not working on google colab. To solve the issue change c++14 to c++17 in setup.py of raymarching, shencoder, freqencoder. it should look like this: import os from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', '-use_fast_math' ] if os.name == "posix": c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] .........
mohammedAHM123 commented 2025-04-25 19:37:35 +08:00 (Migrated from github.com)

@MoeenArif1 what is file in _src_path = os.path.dirname(os.path.abspath(file))

@MoeenArif1 what is `file` in `_src_path = os.path.dirname(os.path.abspath(file))`
Sign in to join this conversation.