laumerf / 4DHeartModel

Framework to enable the inference of a high resolution personalized 4D (3D plus time) surface mesh of the cardiac structures from 2D echocardiography video data.
24 stars 7 forks source link

TypeError: can't pickle vtkmodules.vtkCommonDataModel.vtkPolyData objects #2

Closed SLYXDWL closed 1 year ago

SLYXDWL commented 1 year ago

When I run mva, the following error occurs :( ,

EOFError: Ran out of input TypeError: can't pickle vtkmodules.vtkCommonDataModel.vtkPolyData objects

How can I fix it? Thanks!

laumerf commented 1 year ago

Could you tell me in which file and at which line the error occurs?

davenly1998 commented 1 year ago

The following is the error message content:

This may take a while Traceback (most recent call last): Traceback (most recent call last): File"",line 1,in File "run_generative_heart_model.py",line 1389,in File"C:\Users\fwq44\anaconda3\envs\TF2.3\lib\multiprocessing\spawn.py", line 105, in spawn_main exitcode = _main(fd) File"C:\Users\fwq44\anaconda3\envs\TF2.3\limultiprocessing\spawn.py",line 115,in _main main() self = reduction.pickle.load(from_parent) EOFError: Ran out of input File "run_generative_heart_model.py"line 1323, in main run_dhb_shape_ae(args,dhb_shape_configs) File "run_generative_heart_model.py", line 176,in run_dhb_shape_ae train dataset=data_handlergetdatasetfrom_disk("train"n train_samples) File"D:\dwl\4DHeartModel-main\source\data.py", line 544, in get dataset_from_disk folder,=self._save_files_to_disk_timed_parallel(set_name, n_samples) File"D:\dwl\4DHeartModel-main source\data.py"line 578, in _save_files_to_disk_timed_parallel folder, dataset_params=self._save_files_to_disk_parallel(set_name,n_samples) File"D:\dwl\4DHeartModel-main\source\data.py", line 703,in _save_files_to_disk_parallel p.start() File"C:\Users\fwq44\anaconda3\envs\TF2.3\lib\multiprocessing\process.py", line 112, in start self._popen=self._Popen(self) File"C:\Users\fwq44\anaconda3\envs\TF2.3\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File"C:\Users\fwq44\anaconda3\envs\TF2.3\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj) File "C:\Users\fwq44\anaconda3\envsTF2.3\lib\multiprocessing\popen_spawn_win32.py", line 89,in init reduction.dump(process_obj, to_child) File "C:\Users\fwq44\anaconda3\envs\TF2.3\lib\multiprocessing\reduction.py",line 60,in dump ForkingPickler(file, protocol).dump(obj) TypeError: can't pickle vtkmodules.vtkCommonDataModel.vtkPolyData objects

laumerf commented 1 year ago

Is this the whole stack-trace? It's hard to pin down where exactly the error occurred. Also, the line numbers do not exactly match the ones on github.

Which python version are you using?

laumerf commented 1 year ago

I cloned the repository and ran the code. Unfortunately, I could not reproduce the error and I could run the mva. It worked for me with Python version 3.9.12.

Environment File:

name: 4dheart
channels:
  - pytorch
  - defaults
  - conda-forge
  - bioconda
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - blas=1.0=mkl
  - brotlipy=0.7.0=py39hb9d737c_1004
  - bzip2=1.0.8=h7f98852_4
  - ca-certificates=2023.01.10=h06a4308_0
  - certifi=2022.12.7=py39h06a4308_0
  - cffi=1.14.6=py39he32792d_0
  - charset-normalizer=2.1.0=pyhd8ed1ab_0
  - cryptography=37.0.2=py39hd97740a_0
  - cudatoolkit=11.6.0=hecad31d_10
  - ffmpeg=4.3=hf484d3e_0
  - freetype=2.10.4=h0708190_1
  - gmp=6.2.1=h58526e2_0
  - gnutls=3.6.13=h85f3911_1
  - idna=3.3=pyhd8ed1ab_0
  - intel-openmp=2021.4.0=h06a4308_3561
  - jpeg=9e=h166bdaf_1
  - lame=3.100=h7f98852_1001
  - lcms2=2.12=hddcbb42_0
  - ld_impl_linux-64=2.38=h1181459_1
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libiconv=1.17=h166bdaf_0
  - libllvm11=11.1.0=h9e868ea_6
  - libpng=1.6.37=h21135ba_2
  - libstdcxx-ng=11.2.0=h1234567_1
  - libtiff=4.2.0=hf544144_3
  - libwebp-base=1.2.2=h7f98852_1
  - lz4-c=1.9.3=h9c3ff4c_1
  - mkl=2021.4.0=h06a4308_640
  - mkl-service=2.4.0=py39h7e14d7c_0
  - mkl_fft=1.3.1=py39h0c7bc48_1
  - mkl_random=1.2.2=py39hde0f152_0
  - ncurses=6.3=h5eee18b_3
  - nettle=3.6=he412f7d_0
  - numba=0.56.4=py39h417a72b_0
  - numpy-base=1.23.5=py39h31eccc5_0
  - olefile=0.46=pyh9f0ad1d_1
  - openh264=2.1.1=h780b84a_0
  - openjpeg=2.4.0=hb52868f_1
  - openssl=1.1.1t=h7f8727e_0
  - pip=22.1.2=py39h06a4308_0
  - pycparser=2.21=pyhd8ed1ab_0
  - pyopenssl=22.0.0=pyhd8ed1ab_0
  - pysocks=1.7.1=py39hf3d152e_5
  - python=3.9.12=h12debd9_1
  - python_abi=3.9=2_cp39
  - pytorch=1.12.0=py3.9_cuda11.6_cudnn8.3.2_0
  - pytorch-mutex=1.0=cuda
  - readline=8.1.2=h7f8727e_1
  - requests=2.28.1=pyhd8ed1ab_0
  - six=1.16.0=pyh6c4a22f_0
  - sqlite=3.38.5=hc218d9a_0
  - tbb=2021.8.0=hdb19cb5_0
  - tk=8.6.12=h1ccaba5_0
  - torchaudio=0.12.0=py39_cu116
  - torchvision=0.13.0=py39_cu116
  - typing_extensions=4.3.0=pyha770c72_0
  - tzdata=2022a=hda174b7_0
  - urllib3=1.26.10=pyhd8ed1ab_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.2.5=h7f8727e_1
  - zlib=1.2.12=h7f8727e_2
  - zstd=1.5.0=ha95c52a_0
  - pip:
    - absl-py==1.2.0
    - aiobotocore==2.3.4
    - aiofiles==0.8.0
    - aiohttp==3.8.1
    - aioitertools==0.10.0
    - aiosignal==1.2.0
    - anyio==3.6.1
    - argon2-cffi==21.3.0
    - argon2-cffi-bindings==21.2.0
    - astor==0.8.1
    - asttokens==2.0.5
    - astunparse==1.6.3
    - async-timeout==4.0.2
    - attrs==21.4.0
    - autograd==1.5
    - autograd-gamma==0.5.0
    - backcall==0.2.0
    - beautifulsoup4==4.11.1
    - bidict==0.22.0
    - bleach==5.0.1
    - botocore==1.24.21
    - brotli==1.0.9
    - cachetools==5.2.0
    - cellpose==0.1.dev292+g1db2f77
    - chumpy==0.70
    - click==8.1.3
    - cloudpickle==2.2.0
    - cycler==0.11.0
    - debugpy==1.6.2
    - decorator==5.1.1
    - defusedxml==0.7.1
    - descartes==1.1.0
    - dm-tree==0.1.7
    - dnspython==2.2.1
    - ecdsa==0.18.0
    - elasticdeform==0.4.9
    - elfinder-client==2.1.55a6
    - email-validator==1.2.1
    - entrypoints==0.4
    - executing==0.8.3
    - fastapi==0.79.0
    - fastjsonschema==2.16.1
    - fastremap==1.13.2
    - feather-format==0.4.1
    - flatbuffers==2.0
    - fonttools==4.34.4
    - formulaic==0.5.2
    - frozenlist==1.3.0
    - future==0.18.3
    - gast==0.4.0
    - geojson==2.5.0
    - google-auth==2.9.1
    - google-auth-oauthlib==0.4.6
    - google-pasta==0.2.0
    - gputil==1.4.0
    - grpcio==1.47.0
    - h11==0.13.0
    - h5py==3.7.0
    - hupper==1.10.3
    - imagecodecs==2022.2.22
    - imageio==2.19.5
    - imjoy==0.11.20
    - imjoy-elfinder==0.1.61
    - imjoy-jupyter-extension==0.3.0
    - imjoy-rpc==0.5.15
    - importlib-metadata==4.12.0
    - inflate64==0.3.1
    - interface-meta==1.3.0
    - ipykernel==6.15.1
    - ipython==8.4.0
    - ipython-genutils==0.2.0
    - ipywidgets==7.7.1
    - janus==1.0.0
    - jedi==0.18.1
    - jinja2==3.1.2
    - jmespath==1.0.1
    - joblib==1.1.0
    - jsonschema==4.7.2
    - jupyter==1.0.0
    - jupyter-client==7.3.4
    - jupyter-console==6.4.4
    - jupyter-core==4.11.1
    - jupyterlab-pygments==0.2.2
    - jupyterlab-widgets==1.1.1
    - kaplanmeier==0.1.8
    - keras==2.10.0
    - keras-preprocessing==1.1.2
    - kiwisolver==1.4.4
    - libclang==14.0.1
    - lifelines==0.27.4
    - llvmlite==0.39.1
    - lxml==4.9.1
    - markdown==3.4.1
    - markupsafe==2.1.1
    - matplotlib==3.5.2
    - matplotlib-inline==0.1.3
    - mistune==0.8.4
    - msgpack==1.0.4
    - multidict==6.0.2
    - multivolumefile==0.2.3
    - natsort==8.1.0
    - nbclient==0.6.6
    - nbconvert==6.5.0_
    - nbformat==5.4.0
    - nest-asyncio==1.5.5
    - networkx==2.8.5
    - nibabel==4.0.2
    - notebook==6.4.12
    - numpy==1.22.4
    - oauthlib==3.2.0
    - opencv-python==4.7.0.72
    - opencv-python-headless==4.6.0.66
    - opt-einsum==3.3.0
    - packaging==21.3
    - palettable==3.3.0
    - pandas==1.4.3
    - pandocfilters==1.5.0
    - parso==0.8.3
    - pastedeploy==2.1.1
    - pathvalidate==2.5.0
    - pexpect==4.8.0
    - pickleshare==0.7.5
    - pillow==9.2.0
    - plaster==1.0
    - plaster-pastedeploy==0.7
    - prometheus-client==0.14.1
    - prompt-toolkit==3.0.30
    - protobuf==3.19.4
    - psbody-mesh==0.4
    - psutil==5.9.1
    - ptyprocess==0.7.0
    - pure-eval==0.2.2
    - py7zr==0.20.4
    - pyarrow==11.0.0
    - pyasn1==0.4.8
    - pyasn1-modules==0.2.8
    - pybcj==1.0.1
    - pycox==0.2.3
    - pycryptodomex==3.17
    - pydantic==1.9.1
    - pydicom==2.3.0
    - pygments==2.12.0
    - pyopengl==3.1.6
    - pyparsing==3.0.9
    - pyppmd==1.0.0
    - pyramid==2.0
    - pyramid-jinja2==2.10
    - pyrsistent==0.18.1
    - python-dateutil==2.8.2
    - python-dotenv==0.20.0
    - python-engineio==4.0.0
    - python-jose==3.3.0
    - python-socketio==5.0.4
    - pytz==2022.1
    - pywavelets==1.3.0
    - pyyaml==6.0
    - pyzmq==23.2.0
    - pyzstd==0.15.4
    - qtconsole==5.3.1
    - qtpy==2.1.0
    - read-roi==1.6.0
    - requests-oauthlib==1.3.1
    - rsa==4.9
    - scikit-image==0.19.3
    - scikit-learn==1.1.1
    - scikit-video==1.1.11
    - scipy==1.8.1
    - seaborn==0.12.2
    - send2trash==1.8.0
    - setuptools==67.6.1
    - shapely==1.8.2
    - shortuuid==1.0.9
    - simpleitk==2.2.0
    - sk-video==1.1.10
    - sniffio==1.2.0
    - soupsieve==2.3.2.post1
    - spektral==1.2.0
    - stack-data==0.3.0
    - starlette==0.19.1
    - tensorboard==2.10.1
    - tensorboard-data-server==0.6.1
    - tensorboard-plugin-wit==1.8.1
    - tensorflow==2.10.0
    - tensorflow-addons==0.18.0
    - tensorflow-estimator==2.10.0
    - tensorflow-io-gcs-filesystem==0.26.0
    - tensorflow-probability==0.18.0
    - termcolor==1.1.0
    - terminado==0.15.0
    - texttable==1.6.7
    - threadpoolctl==3.1.0
    - tifffile==2022.5.4
    - tinycss2==1.1.1
    - torchtuples==0.2.2
    - tornado==6.2
    - tqdm==4.64.0
    - traitlets==5.3.0
    - translationstring==1.4
    - typeguard==2.13.3
    - uvicorn==0.18.2
    - venusian==3.0.0
    - vtk==9.1.0
    - waitress==2.1.2
    - wcwidth==0.2.5
    - webencodings==0.5.1
    - webob==1.8.7
    - websockets==10.3
    - werkzeug==2.2.0
    - widgetsnbextension==3.6.1
    - wrapt==1.14.1
    - wslink==1.6.6
    - xvfbwrapper==0.2.9
    - yarl==1.7.2
    - zipp==3.8.1
    - zope-deprecation==4.4.0
    - zope-interface==5.4.0
prefix: /home/fabian/anaconda3/envs/4dheart_
davenly1998 commented 1 year ago

This error seems to be related to the use of multiprocessing in win10. I have temporarily modified the parallel operation section from the code and generated one training mesh video rather than 10(n_paralell) each time to continue running the code.