Livox-SDK / livox_detection

Livox open source detection algorithm
Apache License 2.0
264 stars 55 forks source link

have problem when using python #51

Open samsaber1998 opened 7 months ago

samsaber1998 commented 7 months ago

I create a new folder 'build' in livox detection, then run: (base) shiyanshi@shiyanshi-System-Product-Name:~/livox_detection$ python3 setup.py develop after a long list, I got this: IndexError: list index out of range how to deal wiz it?

yaobaishen commented 6 months ago

I got the same error, dost anyone have encountered the same issue? Traceback (most recent call last): File "setup.py", line 18, in <module> setup( File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup return distutils.core.setup(**attrs) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command super().run_command(command) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/command/develop.py", line 109, in install_for_development self.run_command('build_ext') File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command super().run_command(command) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 88, in run _build_ext.run(self) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run self.build_extensions() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 708, in build_extensions build_ext.build_extensions(self) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions self._build_extensions_serial() File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial self.build_extension(ext) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 249, in build_extension _build_ext.build_extension(self, ext) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension objects = self.compiler.compile( File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 524, in unix_wrap_ninja_compile cuda_post_cflags = unix_cuda_flags(cuda_post_cflags) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 423, in unix_cuda_flags cflags + _get_cuda_arch_flags(cflags)) File "/home/nsoft/anaconda3/envs/livox_sdk/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1561, in _get_cuda_arch_flags arch_list[-1] += '+PTX' IndexError: list index out of range

yaobaishen commented 6 months ago

oh, it looks like my nvidia drivier doesn't work, the nvidia-smi command reports error, try to reboot my machine...

Flexuo commented 6 months ago

Based on the provided information, the error message "IndexError: list index out of range" indicates that the Python code encountered an attempt to access an index of a list that does not exist. This typically happens when the code tries to access an index that is beyond the length of the list.

In this scenario, the error likely occurred during the execution of the setup.py develop command in the livox_detection folder. Without seeing the specific contents of the setup.py file or the context of the error, it's challenging to pinpoint the exact cause. However, here are some common reasons for encountering such an error:

Incorrect List Indexing: The code inside setup.py or any other Python script being executed might be attempting to access a list using an index that doesn't exist.

Parsing Command Line Arguments: If the setup.py script parses command-line arguments, the error could be related to incorrect handling or parsing of the arguments.

Dependencies or Configuration Issues: It's possible that there are missing dependencies or configuration issues within the setup.py script or the environment, leading to unexpected behavior.

Data Processing or Iteration: If the error occurs during data processing or iteration over a list, it could be due to incorrect logic for accessing list elements.

To troubleshoot the issue, you can try the following steps:

Review the contents of the setup.py file in the livox_detection folder to check for any potential errors or issues with list indexing. Ensure that all dependencies required by the livox_detection project are properly installed and configured. Verify the command-line arguments passed to setup.py and ensure they are correctly handled. Look for any recent changes or updates that might have introduced the error.

If you need any further assistance, feel free to reach me out 👍🏻 :)