HuguesTHOMAS / KPConv-PyTorch

Kernel Point Convolution implemented in PyTorch
MIT License
777 stars 155 forks source link

Assistance on KPConv-PyTorch installation (Windows 10) #157

Open RichardSnijder opened 2 years ago

RichardSnijder commented 2 years ago

Hello,

I am planning to use the KPConv-PyTorch. But I need some help installing this on my device. I am fairly new to this environment, perhaps I do not understand what steps to perform. I have looked at the INSTALL.md guide but does not help me a lot..

I am using Windows 10.

Steps performed:

What do I have to do now? Where do I place the extracted zip file? How do I perform the step: 'Compile the C++ extension modules for python located in cpp_wrappers'

Please help me.

Thanks in advance.

Richard

HuguesTHOMAS commented 2 years ago

Where do I place the extracted zip file?

Well in a folder of your choice, that does not really matter. Ideally you want to have this folder containing the code next to a folder called Data, where you will store the data. But this is not compulsory, the path to the data folder can be changed in the code

How do I perform the step: 'Compile the C++ extension modules for python located in cpp_wrappers'

Execute (double click) the .bat file given in INSTALL.md.

Note though that several people had problems with using the code on windows. I strongly advise you to use Linux. I let some instructions for windows for people that would want to use it but have strong implementation skills and would be able to correct the code on their own.

I won't be able to help you much unless you use Linux.

Yarroudh commented 1 year ago

Hello, If you want to compile under windows you should run the build.bat files under cpp_neighbors and cpp_subsampling. You need to change py setup.py build_ext --inplace to python setup.py build_ext --inplace in both files.

  1. Open your anaconda prompt
  2. Create a new environment : conda create -n kpconv python=3.8
  3. Activate your environment: conda activate kpconv(Note: if you use another version of python make sure vc and vs2015_runtime are installed in your conda environment so you can compile C++ extension modules. You can check it using conda list. Also, make sure you have Visual Studio 2015 or higher installed on your machine)
  4. Install the required packages (PyTorch for Windows and other dependencies)
  5. Navigate to KPConv-PyTorch/cpp_wrappers/cpp_neighbors and run build.bat
  6. Change the name of your .pyd file to radius_neighbors.pyd so it can be correctly imported
  7. Do the same thing for cpp_subsampling

You should now be able to use the code for training and testing.