mimesis-inria / deepphysx Goto Github PK
View Code? Open in Web Editor NEWInterfacing AI with numerical simulation.
Home Page: https://deepphysx.readthedocs.io
License: GNU Affero General Public License v3.0
Interfacing AI with numerical simulation.
Home Page: https://deepphysx.readthedocs.io
License: GNU Affero General Public License v3.0
Dear Colleagues,
First of all, thank you very much for this wonderful contribution to the community. We are new in this field, and I was looking for a package in the biomedical domain that helps us in simulation and has a connection with PyTorch and I discovered this gem. I have a few basic questions and I would be thankful if you could answer them:
Thank you very much
thanks for sharing the project.
is there any examples for heart(cardiac)simulation like the liver ?
Tried installing all except Caribou, but trying to launch the demo i get this error
user@eGPULinux:~/Downloads/DeepPhysX/Core$ python3 demo.py liver Traceback (most recent call last): File "/home/user/Downloads/DeepPhysX/Core/examples/demos/Liver/FC/interactive.py", line 19, in <module> LiverDownloader().get_session('predict') File "/home/user/.local/lib/python3.10/site-packages/DeepPhysX/Core/Utils/data_downloader.py", line 55, in get_session self.check_tree(session_name) File "/home/user/.local/lib/python3.10/site-packages/DeepPhysX/Core/Utils/data_downloader.py", line 84, in check_tree if not os.path.exists(os.path.join(self.root, self.tree[last_level], self.filenames[file])): KeyError: 276
Traceback (most recent call last):
File "H:\SOFA\anaconda\Lib\site-packages\vedo\plotter.py", line 2308, in _func_wrap
func(event_dict)
File "H:\DeepPhysX\Core\examples\demos\Liver\FC\Environment\LiverInteractive.py", line 174, in mouse_move
U = self.get_prediction(F).reshape(self.output_size)
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\Environment\BaseEnvironment.py", line 207, in get_prediction
return TcpIpClient.request_get_prediction(self, input_array=input_array)
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\AsyncSocket\TcpIpClient.py", line 225, in request_get_prediction
return self.send_prediction_data(network_input=input_array)
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\AsyncSocket\TcpIpClient.py", line 190, in send_prediction_data
self.sync_send_command_prediction()
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\AsyncSocket\TcpIpObject.py", line 612, in sync_send_command_prediction
self.__sync_send_command(receiver=receiver, command='prediction')
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\AsyncSocket\TcpIpObject.py", line 511, in __sync_send_command
self.sync_send_data(data_to_send=cmd, receiver=receiver)
File "H:\SOFA\anaconda\Lib\site-packages\DeepPhysX\Core\AsyncSocket\TcpIpObject.py", line 96, in sync_send_data
receiver.sendall(data_as_bytes)
ConnectionAbortedError: [WinError 10053] The software in your console aborted an established connection
(py38sofa) PS G:\SOFA_codes\DeepPhysX-v22.12.1> DPX --get
WARNING: The project was installed with pip, examples must be run in a new repository to avoid writing data in your installation of SSD. Allow the creation of this new repository 'G:\SOFA_codes\DeepPhysX-v22.12.1\DPX_examples' to run examples (use 'DPX --clean' to cleanlyremove it afterward) (y/n):y
(py38sofa) PS G:\SOFA_codes\DeepPhysX-v22.12.1> DPX -r liver
urllib3.exceptions.SSLError: TLS/SSL connection has been closed (EOF) (_ssl.c:1135)
The above exception was the direct cause of the following exception:
urllib3.exceptions.ProxyError: ('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)')))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
retries = retries.increment(
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='data-qualif.loria.fr', port=443): Max retries exceeded with url: /api/v1/datasets/:persistentId/?persistentId=doi:10.5072/FK2/ZPFUBK&User-Agent=pydataverse (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)'))))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\pyDataverse\api.py", line 121, in get_request
resp = get(url, params=params)
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\requests\api.py", line 73, in get
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "interactive.py", line 19, in
LiverDownloader().get_session('all')
File "G:\SOFA_codes\DeepPhysX-v22.12.1\DPX_examples\Core\demos\Liver\FC\download.py", line 17, in init
DataDownloader.init(self, DOI, session_name)
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\DeepPhysX\Core\Utils\data_downloader.py", line 16, in init
for file in self.api.get_dataset(DOI).json()['data']['latestVersion']['files']:
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\pyDataverse\api.py", line 1006, in get_dataset
return self.get_request(url, auth=auth)
File "D:\ROOTS\anaconda\envs\py38sofa\lib\site-packages\pyDataverse\api.py", line 139, in get_request
raise ConnectionError(
requests.exceptions.ConnectionError: ERROR: GET - Could not establish connection to api https://data-qualif.loria.fr/api/v1/datasets/:persistentId/?persistentId=doi:10.5072/FK2/ZPFUBK.
(py38sofa) PS G:\SOFA_codes\DeepPhysX-v22.12.1>
Thank you !
I installed the packages by following the instructions and got an error as follows.
Can you help resolving the error?
Core % python3 demo.py armadillo
Connecting to DeepPhysX online storage to download missing data...
Downloading file 1/7 in Environment/models/armadillo.obj
Downloading file 2/7 in Environment/models/armadillo_coarse.obj
Downloading file 3/7 in Environment/models/sparse_grid.obj
Downloading file 4/7 in sessions/armadillo_dpx/infos.txt
Downloading file 5/7 in sessions/armadillo_dpx/dataset/dataset.json
Downloading file 6/7 in sessions/armadillo_dpx/network/network.pth
Downloading file 7/7 in sessions/armadillo_dpx/stats/events.out.tfevents.1651475113.romulus
Directory conflict: you are going to overwrite sessions/armadillo_dpx.
Create a new directory /Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/sessions/armadillo_dpx_1/ for this session.
Traceback (most recent call last):
File "/Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/interactive.py", line 56, in <module>
launch_runner()
File "/Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/interactive.py", line 44, in launch_runner
runner = BaseRunner(session_dir='sessions',
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Pipelines/BaseRunner.py", line 58, in __init__
self.manager = Manager(pipeline=self,
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Manager/Manager.py", line 64, in __init__
self.network_manager = NetworkManager(manager=self,
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Manager/NetworkManager.py", line 56, in __init__
raise ValueError(f"[{self.name}] Training requires a loss and an optimizer in your NetworkConfig")
ValueError: [NetworkManager] Training requires a loss and an optimizer in your NetworkConfig
(deep) zebehn@jangminsuui-MacBookPro Core % python3 demo.py armadillo
Directory conflict: you are going to overwrite sessions/armadillo_dpx.
Create a new directory /Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/sessions/armadillo_dpx_2/ for this session.
Traceback (most recent call last):
File "/Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/interactive.py", line 56, in <module>
launch_runner()
File "/Users/zebehn/Development/DeepPhysX/Core/examples/demos/Armadillo/FC/interactive.py", line 44, in launch_runner
runner = BaseRunner(session_dir='sessions',
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Pipelines/BaseRunner.py", line 58, in __init__
self.manager = Manager(pipeline=self,
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Manager/Manager.py", line 64, in __init__
self.network_manager = NetworkManager(manager=self,
File "/Users/zebehn/opt/anaconda3/envs/deep/lib/python3.10/site-packages/DeepPhysX/Core/Manager/NetworkManager.py", line 56, in __init__
raise ValueError(f"[{self.name}] Training requires a loss and an optimizer in your NetworkConfig")
ValueError: [NetworkManager] Training requires a loss and an optimizer in your NetworkConfig
Hello
I have been trying to build Caribou so I can use DeepPysX.Sofa examples but I have been facing this problem both on windows 10 and similar on ubuntu 22.04
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2377 (find_package_handle_standard_args)
E:/SOFA/SOFA_v22.12.00_Win64/lib/cmake/Sofa.Type/Sofa.TypeConfig.cmake:34 (find_package)
E:/SOFA/SOFA_v22.12.00_Win64/lib/cmake/SofaFramework/SofaFrameworkConfig.cmake:37 (find_package)
cmake/FindSOFA.cmake:19 (find_package)
CMakeLists.txt:57 (find_package)
Is there a way to solve this problem,
Automatic downloading of DeepPhysX demo data is temporary disabled. I can still download the data manually. But after downloading the data, how to run the program normally? Could you please help create an online tutorial? Thank you!
Hi team, really cool work. Would like to give this a spin but am having trouble getting it running on python 3.8 if possible.
Following the install instructions and running a demo like DPX -r liver
leads to the following issue:
DPX --run liver
Traceback (most recent call last):
File "interactive.py", line 11, in <module>
from DeepPhysX.Core.Pipelines.BasePrediction import BasePrediction
File "/home/nina/miniconda3/envs/sofa-frameworks/lib/python3.8/site-packages/DeepPhysX/Core/Pipelines/__init__.py", line 9, in <module>
exec(f"from DeepPhysX.Core.Pipelines.{module[:-3]} import {module[:-3]}")
File "<string>", line 1, in <module>
File "/home/nina/miniconda3/envs/sofa-frameworks/lib/python3.8/site-packages/DeepPhysX/Core/Pipelines/BaseDataGeneration.py", line 3, in <module>
from vedo import ProgressBar
File "/home/nina/miniconda3/envs/sofa-frameworks/lib/python3.8/site-packages/vedo/__init__.py", line 234, in <module>
np.warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning)
File "/home/nina/miniconda3/envs/sofa-frameworks/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'warnings'
Looking up the error, I deprecate the installation of numpy==1.24. to 1.23.5, which leads to a clean run.
Running the following:
conda create --name sofa-frameworks python=3.8
conda activate sofa-frameworks
pip install DeepPhysX DeepPhysX.Sofa DeepPhysX.Torch
DPX -r liver
Fixed by:
conda create --name sofa-frameworks python=3.8
conda activate sofa-frameworks
pip install DeepPhysX DeepPhysX.Sofa DeepPhysX.Torch
pip install numpy==1.23.5
DPX -r liver
It would be worth fixing the requirements as otherwise the package does not install properly? Can I contribute this fix?
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?
For some reason, USER_SITE variable from the package site is not pointing to the correct location when using conda.
Change the USER_SITE variable to site.getsitepackages()[0] solves the problem at my place.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.