Polygonization-by-Frame-Field-Learning
Polygonization-by-Frame-Field-Learning copied to clipboard
An Online Demo
hello, have you save the docker environment and would you please release it for me? I am facing lots of troubles when configuring the environment. many thanks!
I did not use docker to configure the environment, but configured it manually under win11. Which dependency did you have problems installing?
actually I don't know the reason, the errors are as follows, and I can't solve it: so I want to get an environment that can successfully excute this code.Did you use conda environment?
Training on fold(s): ['train']
INFO: Loading defaults from configs/config.defaults.mapping_dataset.json
INFO: Loading defaults from configs/config.defaults.json
INFO: Loading defaults from configs/loss_params.json
INFO: Loading defaults from configs/optim_params.json
INFO: Loading defaults from configs/polygonize_params.json
INFO: Loading defaults from configs/dataset_params.mapping_dataset.json
INFO: Loading defaults from configs/eval_params.mapping_dataset.json
INFO: Loading defaults from configs/eval_params.defaults.json
INFO: Loading defaults from configs/backbone_params.unet_resnet101.json
GPU 0 -> Ready. There are 1 GPU(s) available on this node.
GPU 0 -> Using data from /data/mapping_challenge_dataset
# --- Start training --- #
Train dataset has 210556 samples.
Model has 76686222 trainable params
Init loss norms: 0%| | 0/501 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 403, in <module>
torch.multiprocessing.spawn(train_process, nprocs=args.gpus, args=(config, shared_dict, barrier))
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 200, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 158, in start_processes
while not context.join():
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 119, in join
raise Exception(msg)
Exception:
-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 20, in _wrap
fn(i, *args)
File "/home/jt/code/Polygonization-by-Frame-Field-Learning/child_processes.py", line 50, in train_process
train(gpu, config, shared_dict, barrier, train_ds, val_ds, backbone)
File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/train.py", line 146, in train
trainer.fit(train_dl, val_dl=val_dl, init_dl=init_dl)
File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/trainer.py", line 321, in fit
self.compute_loss_norms(init_dl, loss_norm_batches)
File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/trainer.py", line 289, in compute_loss_norms
for batch in dl:
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 279, in __iter__
return _MultiProcessingDataLoaderIter(self)
File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 719, in __init__
w.start()
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <class 'torch._C._VariableFunctions'>: it's not the same object as torch._C._VariableFunctions
```
actually I don't know the reason, the errors are as follows, and I can't solve it: so I want to get an environment that can successfully excute this code.Did you use conda environment?
Training on fold(s): ['train'] INFO: Loading defaults from configs/config.defaults.mapping_dataset.json INFO: Loading defaults from configs/config.defaults.json INFO: Loading defaults from configs/loss_params.json INFO: Loading defaults from configs/optim_params.json INFO: Loading defaults from configs/polygonize_params.json INFO: Loading defaults from configs/dataset_params.mapping_dataset.json INFO: Loading defaults from configs/eval_params.mapping_dataset.json INFO: Loading defaults from configs/eval_params.defaults.json INFO: Loading defaults from configs/backbone_params.unet_resnet101.json GPU 0 -> Ready. There are 1 GPU(s) available on this node. GPU 0 -> Using data from /data/mapping_challenge_dataset # --- Start training --- # Train dataset has 210556 samples. Model has 76686222 trainable params Init loss norms: 0%| | 0/501 [00:00<?, ?it/s] Traceback (most recent call last): File "main.py", line 403, in <module> torch.multiprocessing.spawn(train_process, nprocs=args.gpus, args=(config, shared_dict, barrier)) File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 200, in spawn return start_processes(fn, args, nprocs, join, daemon, start_method='spawn') File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 158, in start_processes while not context.join(): File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 119, in join raise Exception(msg) Exception: -- Process 0 terminated with the following error: Traceback (most recent call last): File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 20, in _wrap fn(i, *args) File "/home/jt/code/Polygonization-by-Frame-Field-Learning/child_processes.py", line 50, in train_process train(gpu, config, shared_dict, barrier, train_ds, val_ds, backbone) File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/train.py", line 146, in train trainer.fit(train_dl, val_dl=val_dl, init_dl=init_dl) File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/trainer.py", line 321, in fit self.compute_loss_norms(init_dl, loss_norm_batches) File "/home/jt/code/Polygonization-by-Frame-Field-Learning/frame_field_learning/trainer.py", line 289, in compute_loss_norms for batch in dl: File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 279, in __iter__ return _MultiProcessingDataLoaderIter(self) File "/opt/conda/envs/frame_field/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 719, in __init__ w.start() File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/context.py", line 283, in _Popen return Popen(process_obj) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/opt/conda/envs/frame_field/lib/python3.8/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) _pickle.PicklingError: Can't pickle <class 'torch._C._VariableFunctions'>: it's not the same object as torch._C._VariableFunctions
I have not encountered this problem, but I think it should be a Pickle and torch compatibility problem, try to upgrade your torch version to 1.7.1 and upgrade the corresponding torchvision version.
Thanks very much! I tried it but it still don't work. could please share your conda environment configuration(yml files by conda env export > xxxx.yaml)? thanks a lot!
Thanks very much! I tried it but it still don't work. could please share your conda environment configuration(yml files by
conda env export > xxxx.yaml)? thanks a lot! Sorry, my environment has been changed. I redeployed the app on Huggingface with the following specific environment:Successfully installed MarkupSafe-2.1.1 Pillow-8.2.0 PyWavelets-1.4.1 Pygments-2.13.0 affine-2.3.1 alabaster-0.7.12 anyio-3.6.2 babel-2.11.0 bcrypt-4.0.1 cffi-1.15.1 click-7.1.2 click-plugins-1.1.1 cligj-0.7.2 cryptography-38.0.3 cycler-0.11.0 cython-0.29.32 dataclasses-0.6 descartes-1.1.0 dill-0.3.4 docutils-0.19 et-xmlfile-1.1.0 fastapi-0.87.0 ffmpy-0.3.0 fiona-1.8.21 future-0.18.2 gradio-3.6 h11-0.12.0 h5py-2.10.0 httpcore-0.15.0 httpx-0.23.1 imageio-2.9.0 imagesize-1.4.1 importlib-metadata-5.0.0 jinja2-3.1.2 jsmin-3.0.1 kiwisolver-1.4.4 kornia-0.5.0 linkify-it-py-1.0.3 llvmlite-0.39.1 markdown-it-py-2.1.0 matplotlib-3.3.2 mdit-py-plugins-0.3.1 mdurl-0.1.2 multiprocess-0.70.12.2 munch-2.5.0 networkx-2.8.8 numba-0.56.4 numpy-1.23.1 numpydoc-1.5.0 opencv_python-4.5.4.60 openpyxl-3.0.10 orjson-3.8.2 overpy-0.6 paramiko-2.12.0 pycocotools-2.0.3 pycparser-2.21 pycryptodome-3.15.0 pydantic-1.10.2 pydub-0.25.1 pynacl-1.5.0 pyproj-2.5.0 python-multipart-0.0.5 rasterio-1.1.3 rfc3986-1.5.0 scikit-image-0.19.3 scipy-1.4.1 shapely-1.8.1 skan-0.10.0 sklearn-0.0.post1 sniffio-1.3.0 snowballstemmer-2.2.0 snuggs-1.4.7 sphinx-5.3.0 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 starlette-0.21.0 tifffile-2022.10.10 toolz-0.12.0 torch-1.7.0 torchvision-0.8.0 tqdm-4.63.0 uc-micro-py-1.0.1 uvicorn-0.20.0 websockets-10.4 zipp-3.4.0Hope this helps.
In particular, the version of multiprocess is 0.70.12.2
Thank a lot! I can run this code successfully using your environment condifuration.
Thank a lot! I can run this code successfully using your environment condifuration.
Congratulations! You are a student of Wuhan University?
Thank a lot! I can run this code successfully using your environment condifuration.
Congratulations! You are a student of Wuhan University?
yes! My major is remote sensing, are you also in wuhan university?
Thank a lot! I can run this code successfully using your environment condifuration.
Congratulations! You are a student of Wuhan University?
yes! My major is remote sensing, are you also in wuhan university?
朋友是你们学院的研究生,帮她做的。
Thanks very much! I tried it but it still don't work. could please share your conda environment configuration(yml files by
conda env export > xxxx.yaml)? thanks a lot! Sorry, my environment has been changed. I redeployed the app on Huggingface with the following specific environment:Successfully installed MarkupSafe-2.1.1 Pillow-8.2.0 PyWavelets-1.4.1 Pygments-2.13.0 affine-2.3.1 alabaster-0.7.12 anyio-3.6.2 babel-2.11.0 bcrypt-4.0.1 cffi-1.15.1 click-7.1.2 click-plugins-1.1.1 cligj-0.7.2 cryptography-38.0.3 cycler-0.11.0 cython-0.29.32 dataclasses-0.6 descartes-1.1.0 dill-0.3.4 docutils-0.19 et-xmlfile-1.1.0 fastapi-0.87.0 ffmpy-0.3.0 fiona-1.8.21 future-0.18.2 gradio-3.6 h11-0.12.0 h5py-2.10.0 httpcore-0.15.0 httpx-0.23.1 imageio-2.9.0 imagesize-1.4.1 importlib-metadata-5.0.0 jinja2-3.1.2 jsmin-3.0.1 kiwisolver-1.4.4 kornia-0.5.0 linkify-it-py-1.0.3 llvmlite-0.39.1 markdown-it-py-2.1.0 matplotlib-3.3.2 mdit-py-plugins-0.3.1 mdurl-0.1.2 multiprocess-0.70.12.2 munch-2.5.0 networkx-2.8.8 numba-0.56.4 numpy-1.23.1 numpydoc-1.5.0 opencv_python-4.5.4.60 openpyxl-3.0.10 orjson-3.8.2 overpy-0.6 paramiko-2.12.0 pycocotools-2.0.3 pycparser-2.21 pycryptodome-3.15.0 pydantic-1.10.2 pydub-0.25.1 pynacl-1.5.0 pyproj-2.5.0 python-multipart-0.0.5 rasterio-1.1.3 rfc3986-1.5.0 scikit-image-0.19.3 scipy-1.4.1 shapely-1.8.1 skan-0.10.0 sklearn-0.0.post1 sniffio-1.3.0 snowballstemmer-2.2.0 snuggs-1.4.7 sphinx-5.3.0 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 starlette-0.21.0 tifffile-2022.10.10 toolz-0.12.0 torch-1.7.0 torchvision-0.8.0 tqdm-4.63.0 uc-micro-py-1.0.1 uvicorn-0.20.0 websockets-10.4 zipp-3.4.0Hope this helps.In particular, the version of multiprocess is 0.70.12.2
Hi I've also encountered the environment issue, I've checked your Hugging Face commmunity project but only found requirements.txt. May I ask where can I get your complete environment.yml file?