isl-org / DeepLagrangianFluids

Code repository for "Lagrangian Fluid Simulation with Continuous Convolutions", ICLR 2020.
Other
212 stars 41 forks source link

module 'partio' has no attribute 'read' #11

Closed hanlinGao closed 4 years ago

hanlinGao commented 4 years ago

Got this error when I try to run the example

./run_network.py --weights pretrained_model_weights.h5 \
                 --scene example_scene.json \
                 --output example_out \
                 --write-ply \
                 train_network_tf.py

Is the version of partio different now?

benjaminum commented 4 years ago

Hi, For me the example works with the latest version of partio. Can you check if the examples that come with partio work? https://github.com/wdas/partio/tree/main/src/py/example The examples use the write and read functions.

hanlinGao commented 4 years ago

Hi, For me the example works with the latest version of partio. Can you check if the examples that come with partio work? https://github.com/wdas/partio/tree/main/src/py/example The examples use the write and read functions.

Oh I try it again and now i cannot find partio module, so I cannot run the examples. I check the folder where I install it, there are no things like partio.py Can u give me any suggestions what I can do?

benjaminum commented 4 years ago

You can check if the python module has been built. If yes then you should have partio.py and _partio.so in build/src/py.

hanlinGao commented 4 years ago

You can check if the python module has been built. If yes then you should have partio.py and _partio.so in build/src/py.

Finally solve this problem~ there are some problem when build partio.

  1. If it is built without any error but cannot find partio.py, you could read the log carefully, then you might lack swig, doxygen, etc
  2. if it cannot be built and have the error "relocation xxxx failed, recompile with -fPIC". you should first add set(CMAKE_CXX_FLAGS "-fPIC") to the CMakeList right after project(partio LANGUAGES CXX), and switch python to python2.7 (I use python 2.7 to build it but it will finally be installed into python3.8 packages, but it works for me).
  3. finally, for any import error, add path to .so file into LD_LIBRARY_PATH and add path to .py into PYTHONPATH
GUT2060 commented 3 years ago

Hi @HanlinGao @benjaminum , i'm having the same problem , i managed to build it and the partio.py file is in the build/src/py folder , however the detected version of PythonInterp and PythonLibs is python 2.7 .
python -c "import partio" => no module named partio how can i install it under python3 ? @HanlinGao can you please detail the third remark where you add the paths to the variables ?