mimesis-inria / DeepPhysX

Interfacing AI with numerical simulation.
https://deepphysx.readthedocs.io
GNU Affero General Public License v3.0
37 stars 7 forks source link

how to create a new data base #10

Closed 123jjx321 closed 1 year ago

123jjx321 commented 1 year ago

1676382837311 Hi, mimresis you did a really good job, thank a lot for your sharing! do you know how to create a new data base(.db) in order to train a new network to solve different issue? I mean i tought the liver_dpx_converted_training_0.db which you provided would be your training data, and it may like" a force correspoding a vecotor". However, I do not know how the data exactly look like just as the picture shows above when i use Navicat to open it. Would you please tell me how you generate the liver-demo-data-base from the very begginning?

RobinEnjalbert commented 1 year ago

Hi @123jjx321 ,

Thanks a lot again for your interest in the project.

We generated the training data using the SOFA Framework. As you said, the training dataset contains corresponding force -> deformations samples. To create them, we simply numerically define an input force vector to be applied on a deformable object (the liver), then SOFA computes the resulting deformation.

If you want to discover how we implemented it, the code is provided in the DeepPhysX.SOFA demo repository. You can follow the demos README file to understand how to use the several python scripts.

123jjx321 commented 1 year ago

Hi, thank you! But it seems something wrong with the Caribou plugin. When i run the runsofa.py, the result shows: /usr/bin/python3.8 /home/j/DeepPhysX/Sofa/examples/demos/Liver/FC/runSofa.py

---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Warning: environment variable SOFA_ROOT is empty. Trying to guess it.
Guessed SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
[INFO]    [Sofa.Gui] Loaded qt.conf from /home/j/SOFA/v22.12.00/bin/qt.conf customized with Prefix = /home/j/SOFA/v22.12.00
[ERROR]   [SofaRuntime] KeyError: 'CARIBOU_INSTALL'
Traceback (most recent call last):
  File "/home/j/DeepPhysX/Sofa/examples/demos/Liver/FC/runSofa.py", line 36, in <module>
    environment = create_environment()
  File "/home/j/DeepPhysX/Sofa/examples/demos/Liver/FC/runSofa.py", line 28, in create_environment
    env.create()
  File "/home/j/DeepPhysX/Sofa/examples/demos/Liver/FC/Environment/LiverSofa.py", line 61, in create
    SofaRuntime.PluginRepository.addFirstPath(os.environ['CARIBOU_INSTALL'])
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
Process finished with exit code 1

i just followed the caribou download instruction, extract it into "/home/j/SOFA/v22.12.00/plugins/SofaCaribou", and export the PATH in ubuntu20.04 as below

SOFA_ROOT=/home/j/SOFA/v22.12.00

PATH=/home/j/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/j/SOFA/v22.12.00:/home/j/SOFA/v22.12.00/plugins/SofaPython3/lib/python3/site-packages:/usr/bin/python3.8:/home/j/SOFA/v22.12.00/plugins/SofaPython3:/home/j/SOFA/v22.12.00/lib:/home/j/SOFA/v22.12.00/DLLs

PYTHONPATH=/home/j/SOFA/v22.12.00/plugins/SofaPython3/lib/python3/site-packages:/home/j/SOFA/v22.12.00/plugins/SofaCaribou/lib/python3/site-packages

SOFACARIBOU_ROOT=/home/j/SOFA/v22.12.00/plugins/SofaCaribou

SOFAPYTHON3_ROOT=/home/j/SOFA/v22.12.00/plugins/SofaPython3
RobinEnjalbert commented 1 year ago

This is just a mismatch between the Caribou environment variable names: the script is looking for a variable called "CARIBOU_INSTALL" to be able to load the plugin into SOFA with the PluginManager. I just checked in the documentation of Caribou, it seems that the recommended name for this environment variable have change, so you can either rename your "SOFACARIBOU_ROOT" in "CARIBOU_INSTALL" either update the python script to match your installation. I am not familiar with the download installation of SOFA and Caribou, so I cannot ensure that the PluginManager will behave the same as if you built them from source. Tell me if you still have the issue.

123jjx321 commented 1 year ago

Hi, after I re-build the caribou and the sofapython with " out tree build". and run the sunSofa.py, there still some error exists. the "import SofaCaribou" seems not runs will, or maybe some other reason.

j@j:~/DeepPhysX/Sofa/examples/demos/Beam/FC$ python3 runSofa.py
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
[INFO]    [Sofa.Gui] Loaded qt.conf from /home/j/SOFA/v22.12.00/bin/qt.conf customized with Prefix = /home/j/SOFA/v22.12.00
[ERROR]   [PluginManager] Plugin loading failed (/home/j/SOFA/v22.12.00/collections/SofaComponentAll/lib/libSofaComponentAll.so): libSofaSimulationCommon.so.22.12.00: cannot open shared object file: No such file or directory
[ERROR]   [PluginManager] Plugin loading failed (/home/j/SOFA/v22.12.00/plugins/SofaCaribou/lib/libSofaCaribou.so): libSofa.Component.Topology.Container.Constant.so.23.06.99: cannot open shared object file: No such file or directory
[DEPRECATED] [SofaBaseTopology] SofaBaseTopology is deprecated. It will be removed at v23.06. Use Sofa.Component.Topology.Container.Constant, Sofa.Component.Topology.Container.Grid and/or Sofa.Component.Topology.Container.Dynamic instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Constant.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Grid.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Dynamic.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaBaseTopology/lib/libSofaBaseTopology.so
[DEPRECATED] [SofaEngine] SofaGeneralEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Analyze, Sofa.Component.Engine.Generate, Sofa.Component.Engine.Select and Sofa.Component.Engine.Transform instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Analyze.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Generate.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Select.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Transform.so
[DEPRECATED] [SofaGeneralEngine] Moreover, use Sofa.GL.Component.Engine if you need TextureInterpolation.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Engine.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaGeneralEngine/lib/libSofaGeneralEngine.so
[DEPRECATED] [SofaEngine] SofaEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Select instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaEngine/lib/libSofaEngine.so
[DEPRECATED] [SofaOpenglVisual] SofaOpenglVisual is deprecated;. Use Sofa.GL.Component.Rendering2D, Sofa.GL.Component.Rendering3D and Sofa.GL.Component.Shader instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Rendering2D.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Rendering3D.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Shader.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaOpenglVisual/lib/libSofaOpenglVisual.so
[DEPRECATED] [SofaBoundaryCondition] SofaBoundaryCondition is deprecated. It will be removed at v23.06. You may use Sofa.Component.Constraint.Projective and Sofa.Component.MechanicalLoad instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Constraint.Projective.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.MechanicalLoad.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaBoundaryCondition/lib/libSofaBoundaryCondition.so
[ERROR]   [RequiredPlugin(unnamed)] Plugin loading failed (/home/j/SOFA/v22.12.00/collections/SofaComponentAll/lib/libSofaComponentAll.so): libSofaSimulationCommon.so.22.12.00: cannot open shared object file: No such file or directory
Plugin loading failed (/home/j/SOFA/v22.12.00/plugins/SofaCaribou/lib/libSofaCaribou.so): libSofa.Component.Topology.Container.Constant.so.23.06.99: cannot open shared object file: No such file or directory

Failed to load: ["SofaComponentAll", "SofaCaribou"]
[ERROR]   [SofaRuntime] ValueError: Object type StaticODESolver<> was not created  
The object 'StaticODESolver' is not in the factory.  

But the following exits:

Traceback (most recent call last):
  File "runSofa.py", line 35, in <module>
    environment = create_environment()
  File "runSofa.py", line 27, in create_environment
    env.create()
  File "/home/j/DeepPhysX/Sofa/examples/demos/Beam/FC/Environment/BeamSofa.py", line 74, in create
    self.createFEM()
  File "/home/j/DeepPhysX/Sofa/examples/demos/Beam/FC/Environment/BeamSofa.py", line 87, in createFEM
    self.solver = self.root.fem.addObject('StaticODESolver', name='ODESolver', newton_iterations=20,

I am a new here, not familiar neither the Caribou nor the Sofa, but i really want to run your code to go on my study. Would you please tell me the exactly version of the all the plugin you mentioned, and what step you do to run this code successfully?

I mean like which python version you use, which version of your sofa(build from source or just download .run file), did you build SofaPython by "in-tree-build" or "out-tree-build"?how you build the caribou(exactly like this)? what is your environment variables(through export $PATH ... or change from "vim etc/environment"). Maybe just use other computer and build all of it again to re-run your code successfully, and re-write a guide document with more detail.

123jjx321 commented 1 year ago

Hi, now, there seems have no error in sofa(by copy file from "collection" into "lib"or add "22.12.00" at the end of .so file). but still, there is the error like: [ERROR] [SofaRuntime] TypeError: add_mesh() got an unexpected keyword argument 'positions'

when I run the /home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/dataset.py

**the warning or non-error message in log:**
/usr/bin/python3.8 /home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/dataset.py 
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
Create a new directory /home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/sessions/beam_data_user for this session.
Create a new directory /home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/sessions/beam_data_user/dataset for this session.
[TcpIpServer] Binding to IP Address: localhost on PORT: 10000 with maximum client count: 100
[TcpIpServer] Waiting for clients...
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/j/SOFA/v22.12.00
---------------------------------------
[TcpIpServer] Client n°2 connected: <socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 10000), raddr=('127.0.0.1', 46990)>
[TcpIpServer] Client n°1 connected: <socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 10000), raddr=('127.0.0.1', 47000)>
[TcpIpServer] Client n°4 connected: <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 10000), raddr=('127.0.0.1', 47016)>
[TcpIpServer] Client n°3 connected: <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 10000), raddr=('127.0.0.1', 47020)>
[TcpIpServer] Initializing clients...
[DEPRECATED] [SofaBaseCollision] SofaBaseCollision is deprecated;. It will be removed at v23.06. You may use Sofa.Component.Collision.Geometry, Sofa.Component.Collision.Detection.Algorithm, Sofa.Component.Collision.Detection.Intersection, Sofa.Component.Collision.Response.Mapper and Sofa.Component.Collision.Response.Contact instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Collision.Geometry.so
[WARNING] [ObjectFactory] Class already registered: BVHNarrowPhase
[WARNING] [ObjectFactory] Class already registered: BruteForceBroadPhase
[WARNING] [ObjectFactory] Class already registered: BruteForceDetection
[WARNING] [ObjectFactory] Class already registered: DefaultPipeline
[WARNING] [ObjectFactory] Class already registered: DirectSAP
[WARNING] [ObjectFactory] Class already registered: DirectSAPNarrowPhase
[WARNING] [ObjectFactory] Class already registered: IncrSAP
[WARNING] [ObjectFactory] Class already registered: RayTraceDetection
[WARNING] [ObjectFactory] Class already registered: RayTraceNarrowPhase
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Collision.Detection.Algorithm.so
[WARNING] [ObjectFactory] Class already registered: DiscreteIntersection
[WARNING] [ObjectFactory] Class already registered: LocalMinDistance
[WARNING] [ObjectFactory] Class already registered: MinProximityIntersection
[WARNING] [ObjectFactory] Class already registered: NewProximityIntersection
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Collision.Detection.Intersection.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Collision.Response.Mapper.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Collision.Response.Contact.so
[DEPRECATED] [SofaBaseLinearSolver] SofaBaseLinearSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.LinearSolver.Iterative instead.
[WARNING] [ObjectFactory] Default template for class CGLinearSolver already registered (GraphScattered), do not register GraphScattered as the default
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixMat2x2d>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixMat3x3d>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixMat4x4d>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixMat6x6d>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixMat8x8d>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<CompressedRowSparseMatrixd>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<FullMatrix>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<GraphScattered>
[WARNING] [ObjectFactory] Class already registered: CGLinearSolver<SparseMatrix>
[WARNING] [ObjectFactory] Default template for class MinResLinearSolver already registered (GraphScattered), do not register GraphScattered as the default
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixMat2x2d>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixMat3x3d>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixMat4x4d>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixMat6x6d>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixMat8x8d>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<CompressedRowSparseMatrixd>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<FullMatrix>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<GraphScattered>
[WARNING] [ObjectFactory] Class already registered: MinResLinearSolver<SparseMatrix>
[WARNING] [ObjectFactory] Default template for class ShewchukPCGLinearSolver already registered (GraphScattered), do not register GraphScattered as the default
[WARNING] [ObjectFactory] Class already registered: ShewchukPCGLinearSolver<GraphScattered>
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.LinearSolver.Iterative.so
[DEPRECATED] [SofaBaseMechanics] SofaBaseMechanics is being deprecated;. It will be removed at v23.06. You may use Sofa.Component.Mass and Sofa.Component.Mapping and Sofa.Component.StateContainer instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Mass.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Mapping.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.StateContainer.so
[DEPRECATED] [SofaBaseTopology] SofaBaseTopology is deprecated. It will be removed at v23.06. Use Sofa.Component.Topology.Container.Constant, Sofa.Component.Topology.Container.Grid and/or Sofa.Component.Topology.Container.Dynamic instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Constant.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Grid.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Container.Dynamic.so
[DEPRECATED] [SofaBaseUtils] SofaBaseUtils is deprecated. It will be removed at v23.06. Use Sofa.Component.SceneUtility instead.
[DEPRECATED] [SofaBaseVisual] SofaBaseVisual is deprecated. It will be removed at v23.06. Use Sofa.Component.Visual and Sofa.Component.Setting instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Visual.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Setting.so
[DEPRECATED] [SofaDeformable] SofaDeformable is deprecated. It will be removed at v23.06. Use Sofa.Component.SolidMechanics.Spring instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SolidMechanics.Spring.so
[DEPRECATED] [SofaEngine] SofaEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Select instead.
[WARNING] [ObjectFactory] Default template for class BoxROI already registered (Vec3d), do not register Vec3d as the default
[WARNING] [ObjectFactory] Class already registered: BoxROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: BoxROI<Vec1d>
[WARNING] [ObjectFactory] Class already registered: BoxROI<Vec2d>
[WARNING] [ObjectFactory] Class already registered: BoxROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: BoxROI<Vec6d>
[WARNING] [ObjectFactory] Class already registered: ComplementaryROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<I>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<Vec2d>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<Vec3d>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<d>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<fixed_array<I,2>>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<fixed_array<I,3>>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<fixed_array<I,4>>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<fixed_array<I,8>>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<i>
[WARNING] [ObjectFactory] Class already registered: IndicesFromValues<string>
[WARNING] [ObjectFactory] Class already registered: MergeROIs
[WARNING] [ObjectFactory] Class already registered: MeshBoundaryROI
[WARNING] [ObjectFactory] Default template for class MeshROI already registered (Vec3d), do not register Vec3d as the default
[WARNING] [ObjectFactory] Class already registered: MeshROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: MeshROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: MeshROI<Vec6d>
[WARNING] [ObjectFactory] Default template for class MeshSampler already registered (Vec3d), do not register Vec3d as the default
[WARNING] [ObjectFactory] Class already registered: MeshSampler<Vec3d>
[WARNING] [ObjectFactory] Default template for class MeshSplittingEngine already registered (Vec3d), do not register Vec3d as the default
[WARNING] [ObjectFactory] Class already registered: MeshSplittingEngine<Vec3d>
[WARNING] [ObjectFactory] Default template for class MeshSubsetEngine already registered (Vec3d), do not register Vec3d as the default
[WARNING] [ObjectFactory] Class already registered: MeshSubsetEngine<Vec3d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Rigid2d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Vec1d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Vec2d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: NearestPointROI<Vec6d>
[WARNING] [ObjectFactory] Class already registered: PairBoxROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: PairBoxROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: PairBoxROI<Vec6d>
[WARNING] [ObjectFactory] Class already registered: PlaneROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: PlaneROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: PointsFromIndices<Vec3d>
[WARNING] [ObjectFactory] Class already registered: ProximityROI<Vec3d>
[WARNING] [ObjectFactory] Default template for class SelectConnectedLabelsROI already registered (I), do not register I as the default
[WARNING] [ObjectFactory] Class already registered: SelectConnectedLabelsROI<B>
[WARNING] [ObjectFactory] Class already registered: SelectConnectedLabelsROI<H>
[WARNING] [ObjectFactory] Class already registered: SelectConnectedLabelsROI<I>
[WARNING] [ObjectFactory] Class already registered: SelectConnectedLabelsROI<i>
[WARNING] [ObjectFactory] Default template for class SelectLabelROI already registered (I), do not register I as the default
[WARNING] [ObjectFactory] Class already registered: SelectLabelROI<B>
[WARNING] [ObjectFactory] Class already registered: SelectLabelROI<H>
[WARNING] [ObjectFactory] Class already registered: SelectLabelROI<I>
[WARNING] [ObjectFactory] Class already registered: SelectLabelROI<i>
[WARNING] [ObjectFactory] Class already registered: SphereROI<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: SphereROI<Vec3d>
[WARNING] [ObjectFactory] Class already registered: SubsetTopology<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: SubsetTopology<Vec3d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<I>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<RigidCoord2d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<RigidCoord3d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<RigidDeriv2d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<RigidDeriv3d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<Vec2d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<Vec3d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<Vec4d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<Vec6d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<fixed_array<I,2>>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<fixed_array<I,3>>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<fixed_array<I,4>>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<fixed_array<I,8>>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<i>
[WARNING] [ObjectFactory] Class already registered: ValuesFromIndices<string>
[WARNING] [ObjectFactory] Class already registered: ValuesFromPositions<Rigid3d>
[WARNING] [ObjectFactory] Class already registered: ValuesFromPositions<Vec3d>
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Select.so
[DEPRECATED] [SofaExplicitOdeSolver] SofaExplicitOdeSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.ODESolver.Forward instead.
[WARNING] [ObjectFactory] Class already registered: EulerExplicitSolver
[WARNING] [ObjectFactory] Class already registered: CentralDifferenceSolver
[WARNING] [ObjectFactory] Class already registered: RungeKutta2Solver
[WARNING] [ObjectFactory] Class already registered: RungeKutta4Solver
[WARNING] [ObjectFactory] Class already registered: DampVelocitySolver
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.ODESolver.Forward.so
[DEPRECATED] [SofaImplicitOdeSolver] SofaImplicitOdeSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.ODESolver.Backward instead.
[WARNING] [ObjectFactory] Class already registered: EulerImplicitSolver
[WARNING] [ObjectFactory] Class already registered: StaticSolver
[WARNING] [ObjectFactory] Class already registered: VariationalSymplecticSolver
[WARNING] [ObjectFactory] Class already registered: NewmarkImplicitSolver
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.ODESolver.Backward.so
[DEPRECATED] [SofaLoader] SofaLoader is deprecated. It will be removed at v23.06. Use Sofa.Component.IO.Mesh instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.IO.Mesh.so
[DEPRECATED] [SofaMeshCollision] SofaMeshCollision is being deprecated;. It will be removed at v23.06. You may use Sofa.Component.Collision.Geometry, Sofa.Component.Collision.Detection.Intersection, Sofa.Component.Collision.Response.Mapper and Sofa.Component.Collision.Response.Contact instead.
[DEPRECATED] [SofaObjectInteraction] SofaObjectInteraction is deprecated. It will be removed at v23.06. Use Sofa.Component.Collision.Response.Contactinstead.
[DEPRECATED] [SofaRigid] SofaRigid is being deprecated. It will be removed at v23.06. You may use Sofa.Component.Mapping and Sofa.Component.SolidMechanics.Spring instead.
[DEPRECATED] [SofaSimpleFem] SofaSimpleFem is deprecated;. It will be removed at v23.06. You may use Sofa.Component.Diffusion and Sofa.Component.SolidMechanics.FEM.Elastic instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Diffusion.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SolidMechanics.FEM.Elastic.so
[DEPRECATED] [SofaBoundaryCondition] SofaBoundaryCondition is deprecated. It will be removed at v23.06. You may use Sofa.Component.Constraint.Projective and Sofa.Component.MechanicalLoad instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Constraint.Projective.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.MechanicalLoad.so
[DEPRECATED] [SofaConstraint] SofaConstraint is deprecated. It will be removed at v23.06. You may use Sofa.Component.Mapping.MappedMatrix, Sofa.Component.Constraint.Lagrangian.Model, Sofa.Component.Constraint.Lagrangian.Correction, Sofa.Component.Constraint.Lagrangian.Solver, Sofa.Component.AnimationLoop, Sofa.Component.Collision.Detection.Intersection and Sofa.Component.Collision.Response.Contact instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Mapping.MappedMatrix.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Constraint.Lagrangian.Model.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Constraint.Lagrangian.Correction.so
[WARNING] [ObjectFactory] Class already registered: GenericConstraintSolver
[WARNING] [ObjectFactory] Class already registered: LCPConstraintSolver
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Constraint.Lagrangian.Solver.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.AnimationLoop.so
[DEPRECATED] [SofaGeneralAnimationLoop] SofaGeneralAnimationLoop is deprecated. It will be removed at v23.06. You may use Sofa.Component.Mapping.MappedMatrix and Sofa.Component.AnimationLoop instead.
[DEPRECATED] [SofaGeneralDeformable] SofaGeneralDeformable is deprecated. It will be removed at v23.06. Use Sofa.Component.SolidMechanics.Spring and ofa.Component.SolidMechanics.TensorMass instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SolidMechanics.TensorMass.so
[DEPRECATED] [SofaEngine] SofaGeneralEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Analyze, Sofa.Component.Engine.Generate, Sofa.Component.Engine.Select and Sofa.Component.Engine.Transform instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Analyze.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Generate.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Engine.Transform.so
[DEPRECATED] [SofaGeneralEngine] Moreover, use Sofa.GL.Component.Engine if you need TextureInterpolation.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Engine.so
[DEPRECATED] [SofaGeneralExplicitOdeSolver] SofaGeneralExplicitOdeSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.ODESolver.Forward instead.
[DEPRECATED] [SofaGeneralImplicitOdeSolver] SofaGeneralImplicitOdeSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.ODESolver.Backward instead.
[DEPRECATED] [SofaGeneralLinearSolver] SofaGeneralLinearSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.LinearSolver.Iterative and Sofa.Component.LinearSolver.Direct instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.LinearSolver.Direct.so
[DEPRECATED] [SofaGeneralLoader] SofaGeneralLoader is deprecated. It will be removed at v23.06. Use Sofa.Component.IO.Mesh and/or Sofa.Component.Playback instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Playback.so
[DEPRECATED] [SofaGeneralMeshCollision] SofaGeneralMeshCollision is being deprecated;. It will be removed at v23.06. You may use Sofa.Component.Collision.Geometry, Sofa.Component.Collision.Detection.Algorithm and Sofa.Component.Collision.Detection.Intersection instead.
[DEPRECATED] [SofaGeneralObjectInteraction] SofaGeneralObjectInteraction is being deprecated. It will be removed at v23.06. Use Sofa.Component.SolidMechanics.Spring, Sofa.Component.Constraint.Projective and Sofa.Component.MechanicalLoad instead.
[DEPRECATED] [SofaGeneralRigid] SofaGeneralRigid is being deprecated. It will be removed at v23.06. You may use Sofa.Component.Mapping instead.
[DEPRECATED] [SofaGeneralSimpleFem] SofaGeneralSimpleFem is deprecated. It will be removed at v23.06. Use Sofa.Component.SolidMechanics.FEM.Elastic instead.
[DEPRECATED] [SofaGeneralTopology] SofaGeneralTopology is deprecated;. It will be removed at v23.06. Use Sofa.Component.Topology.Container.Constant and/or Sofa.Component.Topology.Container.Grid instead.
[DEPRECATED] [SofaGeneralVisual] SofaGeneralVisual is deprecated. It will be removed at v23.06. Use Sofa.Component.Visual instead.
[DEPRECATED] [SofaGraphComponent] SofaGraphComponent is deprecated. It will be removed at v23.06. Use Sofa.Component.SceneUtility, Sofa.Component.Setting and Sofa.GUI.Component instead.
[WARNING] [ObjectFactory] Class already registered: AddDataRepository
[WARNING] [ObjectFactory] Class already registered: AddPluginRepository
[WARNING] [ObjectFactory] Class already registered: APIVersion
[WARNING] [ObjectFactory] Class already registered: InfoComponent
[WARNING] [ObjectFactory] Class already registered: MakeAlias
[WARNING] [ObjectFactory] Class already registered: MakeDataAlias
[WARNING] [ObjectFactory] Class already registered: MessageHandlerComponent
[WARNING] [ObjectFactory] Class already registered: FileMessageHandlerComponent
[WARNING] [ObjectFactory] Class already registered: PauseAnimationOnEvent
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SceneUtility.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GUI.Component.so
[DEPRECATED] [SofaTopologyMapping] SofaTopologyMapping is deprecated;. It will be removed at v23.06. You may use Sofa.Component.Topology.Mapping and/or Sofa.Component.Mapping instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Mapping.so
[DEPRECATED] [SofaUserInteraction] SofaUserInteraction is being deprecated;. It will be removed at v23.06. You may use Sofa.Component.Collision.Geometry, Sofa.Component.Collision.Detection.Algorithm, Sofa.Component.Collision.Detection.Intersection. Sofa.Component.Collision.Response.Contact, Sofa.Component.Controller and Sofa.GUI.Component instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Controller.so
[DEPRECATED] [SofaNonUniformFem] SofaNonUniformFem is deprecated. It will be removed at v23.06. You may use Sofa.Component.SolidMechanics.FEM.NonUniform, Sofa.Component.Topology.Container.Dynamic and Sofa.Component.Topology.Container.Grid instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SolidMechanics.FEM.NonUniform.so
[DEPRECATED] [SofaMiscCollision] SofaMiscCollision is deprecated. It will be removed at v23.06. Use Sofa.Component.Collision.Geometry, Sofa.Component.Collision.Detection.Intersection and Sofa.Component.Collision.Response.Contact instead.
[DEPRECATED] [SofaMiscCollision] If you are looking for OBB and Capsule-related components, please use the external plugin CollisionOBBCapsule.
[DEPRECATED] [SofaMiscEngine] SofaMiscEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Analyze and Sofa.Component.Engine.Transform instead.
[DEPRECATED] [SofaMiscExtra] SofaMiscExtra is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Generate instead.
[DEPRECATED] [SofaMiscFem] SofaMiscFem is deprecated. It will be removed at v23.06. Use Sofa.Component.SolidMechanics.FEM.Elastic, Sofa.Component.SolidMechanics.FEM.HyperElastic and Sofa.Component.SolidMechanics.TensorMass instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.SolidMechanics.FEM.HyperElastic.so
[DEPRECATED] [SofaMiscForceField] SofaMiscForceField is being deprecated;. It will be removed at v23.06. You may use Sofa.Component.Mass and Sofa.Component.SolidMechanics.FEM.Elastic instead.
[DEPRECATED] [SofaMiscMapping] SofaMiscMapping is deprecated. It will be removed at v23.06. Use Sofa.Component.Mapping instead.
[DEPRECATED] [SofaMiscSolver] SofaMiscSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.ODESolver.Forward and/or Sofa.Component.ODESolver.Backward instead.
[DEPRECATED] [SofaMiscTopology] SofaMiscTopology is deprecated. It will be removed at v23.06. Use Sofa.Component.Topology.Utility instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Topology.Utility.so
[DEPRECATED] [SofaDenseSolver] SofaDenseSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.LinearSolver.Direct instead.
[DEPRECATED] [SofaExporter] SofaExporter is deprecated. It will be removed at v23.06. Use Sofa.Component.IO.Mesh and/or Sofa.Component.Playback instead.
[DEPRECATED] [SofaHaptics] SofaHaptics is deprecated. It will be removed at v23.06. Use Sofa.Component.Haptics instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.Haptics.so
[DEPRECATED] [SofaOpenglVisual] SofaOpenglVisual is deprecated;. Use Sofa.GL.Component.Rendering2D, Sofa.GL.Component.Rendering3D and Sofa.GL.Component.Shader instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Rendering2D.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Rendering3D.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.GL.Component.Shader.so
[DEPRECATED] [SofaPreconditioner] SofaPreconditioner is deprecated. It will be removed at v23.06. Use Sofa.Component.LinearSolver.Preconditioner and Sofa.Component.LinearSolver.Iterative instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofa.Component.LinearSolver.Preconditioner.so
[DEPRECATED] [SofaSparseSolver] SofaSparseSolver is deprecated. It will be removed at v23.06. Use Sofa.Component.LinearSolver.Direct instead.
[DEPRECATED] [SofaValidation] SofaValidation is deprecated. It will be removed at v23.06. For CompareState and CompareTopology, use Sofa.Component.Playback instead.
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/lib/libSofaComponentAll.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/caribou/build/install/lib/libSofaCaribou.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaBaseTopology/lib/libSofaBaseTopology.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaGeneralEngine/lib/libSofaGeneralEngine.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaEngine/lib/libSofaEngine.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaOpenglVisual/lib/libSofaOpenglVisual.so
[INFO]    [PluginManager] Loaded plugin: /home/j/SOFA/v22.12.00/collections/SofaBoundaryCondition/lib/libSofaBoundaryCondition.so

**the following is the error log:**
[WARNING] [Node(root)] An animation loop is required, but has not been found. Add an animation loop in the root of your scene to fix this warning. The list of available animation loop components is: [ConstraintAnimationLoop, DefaultAnimationLoop, FreeMotionAnimationLoop, MultiStepAnimationLoop, MultiTagAnimationLoop]. A component of type DefaultAnimationLoop will be automatically added for you.
[ERROR]   [SofaRuntime] TypeError: add_mesh() got an unexpected keyword argument 'positions'
Traceback (most recent call last):
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Sofa/Environment/launcherSofaEnvironment.py", line 27, in <module>
    client.initialize()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpClient.py", line 58, in initialize
    async_run(self.__initialize())
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpClient.py", line 104, in __initialize
    self.environment._create_visualization(visualization_db=db)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Sofa/Environment/SofaEnvironment.py", line 189, in _create_visualization
    self.init_visualization()
  File "/home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/Environment/BeamTraining.py", line 51, in init_visualization
    self.factory.add_mesh(positions=self.f_visu.position.value.copy(),

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/Environment/BaseEnvironmentConfig.py", line 142, in start_server
    server.initialize(visualization_db=visualization_db,
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpServer.py", line 134, in initialize
    async_run(self.__initialize(env_kwargs, visualization_db))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpServer.py", line 183, in __initialize
    await self.receive_data(loop=loop, sender=client)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpObject.py", line 111, in receive_data
    nb_bytes_fields = self.data_converter.size_from_bytes(nb_bytes_fields_b)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/BytesConverter.py", line 42, in <lambda>
    self.size_from_bytes: Callable[[bytes], int] = lambda b: self.__bytes_to_data_conversion[int.__name__](b)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/BytesConverter.py", line 34, in <lambda>
    int.__name__: lambda b: unpack('i', b)[0],
struct.error: unpack requires a buffer of 4 bytes
RobinEnjalbert commented 1 year ago

Hi @123jjx321,

Glad to see that you solved your installation errors by yourself. The documentation of DeepPhysX is already referencing each dependency (that I do not manage except SSD), and linking to a detailed documentation on how to install them. If you think that there is a missing point in the instruction on how to install SOFA or Caribou, please directly contact them on their Git repository.

About the error that you have now, this is the same that reported in this issue. I forget to correctly update some examples in the DeepPhysX.Sofa package with the new version of SSD. The examples are now up to date on the master branch of DeepPhysX.Sofa.

123jjx321 commented 1 year ago

Hi, did you mean I just need to re-install the packages: DeepPhysX/DeepPhysX.Sofa/DeepPhysX.Torch/SSD, the problem will be gone?

But I re-installed those packages, and now those versions are DeepPhysX-22.12.1/DeepPhysX.Sofa-22.12.1/DeepPhysX.Torch-22.12/SSD-22.12.4

when i run the /home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FCdataset.py,the error problem is just the same and is as follow, it seems there did not have value in 'positions', cause the 'self.f_visu' = None

[ERROR]   [SofaRuntime] TypeError: add_mesh() got an unexpected keyword argument 'positions'
Traceback (most recent call last):
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Sofa/Environment/launcherSofaEnvironment.py", line 27, in <module>
    client.initialize()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpClient.py", line 58, in initialize
    async_run(self.__initialize())
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpClient.py", line 104, in __initialize
    self.environment._create_visualization(visualization_db=db)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Sofa/Environment/SofaEnvironment.py", line 189, in _create_visualization
    self.init_visualization()
  File "/home/j/Desktop/DeepPhysX/Sofa/examples/demos/Beam/FC/Environment/BeamTraining.py", line 51, in init_visualization
    self.factory.add_mesh(positions=self.f_visu.position.value.copy(),

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/Environment/BaseEnvironmentConfig.py", line 142, in start_server
    server.initialize(visualization_db=visualization_db,
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpServer.py", line 134, in initialize
    async_run(self.__initialize(env_kwargs, visualization_db))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpServer.py", line 183, in __initialize
    await self.receive_data(loop=loop, sender=client)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/TcpIpObject.py", line 111, in receive_data
    nb_bytes_fields = self.data_converter.size_from_bytes(nb_bytes_fields_b)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/BytesConverter.py", line 42, in <lambda>
    self.size_from_bytes: Callable[[bytes], int] = lambda b: self.__bytes_to_data_conversion[int.__name__](b)
  File "/home/j/.local/lib/python3.8/site-packages/DeepPhysX/Core/AsyncSocket/BytesConverter.py", line 34, in <lambda>
    int.__name__: lambda b: unpack('i', b)[0],
struct.error: unpack requires a buffer of 4 bytes
RobinEnjalbert commented 1 year ago

Hi,

I just meant that only the examples are not up to date with the latest versions of the packages. Your installation seems to be perfectly working, the error that you have is a mistake that I made when I packaged the latest version of DeepPhysX.SOFA - I forgot to include the updates of the new SSD version in the demos of DeepPhysX.Sofa. I will include the fix in the next version of the package, so for now, all you need to do is to get the right code of the demos on the master branch of DeepPhysX.Sofa (this was the latest commit on the repo).