Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when running "initialSP_prepare_S3DIS.py" #23

Open
xuzijian-hik opened this issue Oct 12, 2024 · 5 comments
Open

Error occurs when running "initialSP_prepare_S3DIS.py" #23

xuzijian-hik opened this issue Oct 12, 2024 · 5 comments

Comments

@xuzijian-hik
Copy link

Hi! I met some errors when running "initialSP_prepare_S3DIS.py" with the command python data_prepare/initialSP_prepare_S3DIS.py.
Here is the output of the terminal:

xzj@xzj:~/githouse/GrowSP$ python data_prepare/initialSP_prepare_S3DIS.py
/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/site-packages/MinkowskiEngine/__init__.py:36: UserWarning: The environment variable `OMP_NUM_THREADS` not set. MinkowskiEngine will automatically set `OMP_NUM_THREADS=16`. If you want to set `OMP_NUM_THREADS` manually, please export it on the command line before running a python script. e.g. `export OMP_NUM_THREADS=12; python your_program.py`. It is recommended to set it below 24.
  warnings.warn(
start constructing initial superpoints
concurrent.futures.process._RemoteTraceback:
Traceback (most recent call last):
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/process.py", line 239, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/process.py", line 198, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/process.py", line 198, in <listcomp>
    return [fn(*args) for args in chunk]
  File "data_prepare/initialSP_prepare_S3DIS.py", line 78, in construct_superpoints
    coords = coords.numpy().astype(np.float32)
AttributeError: 'numpy.ndarray' object has no attribute 'numpy'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "data_prepare/initialSP_prepare_S3DIS.py", line 155, in <module>
    result = list(pool.map(construct_superpoints, path_list))
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/process.py", line 484, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/_base.py", line 619, in result_iterator
    yield fs.pop().result()
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/_base.py", line 444, in result
    return self.__get_result()
  File "/home/xuzijian/anaconda3/envs/growsp2/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
AttributeError: 'numpy.ndarray' object has no attribute 'numpy'

my enverinment is:

cudatookit=11.8
torch=2.0.0
torchaudio=2.0.1
torchvision=0.15.1
numpy=1.21.5
pandas=1.4.3
qhul=2015.2
pclpy=0.12.0
matplotlib=3.7.5
ninja=1.10.2.3
open3d=0.10.0.0
scikit-learn=0.22.2
scipy=1.10.1
seaborn=0.13.2

Although my CUDA version is 11.8, I think it may not be the reason of numpy error.
I also tried to uninstall numpy & pandas and then reinstall them, but the error still exists.
What can I do?

@zhang-zihui
Copy link
Contributor

Hi, @xuzijian-hik,

It seems the error occurred in line78, this line is to covert the 'coords' from torch.tensor to numpy array. You can debug it to check if it is already a numpy array, and only convert its type to np.float32.

And I'm not sure your MinkowskiEngine version, is it 0.5.4?

Regards,
zihui

@xuzijian-hik
Copy link
Author

Hi, @xuzijian-hik,

It seems the error occurred in line78, this line is to covert the 'coords' from torch.tensor to numpy array. You can debug it to check if it is already a numpy array, and only convert its type to np.float32.

And I'm not sure your MinkowskiEngine version, is it 0.5.4?

Regards, zihui

Thanks for your reply! I solve this problem by installing CUDA11.3. I think it might be something wrong with the MinkowskiEngine in CUDA11.8.

@MarcusnHuang
Copy link

Hello, I have also encountered the same problem. I installed CUDA11.3 and Minkowski Engine 0.5.4. May I ask if it is due to a version issue with Minkowski Engine? Looking forward to your reply

@zhang-zihui
Copy link
Contributor

I have never encountered this issue in Mink0.5.4, so I'm not sure it. You can directly modify the code to convert output to numpy.

@zhang-zihui
Copy link
Contributor

And CUDA 11.8 can also work for this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants