tsinghua-fib-lab / DRL-urban-planning

A deep reinforcement learning (DRL) based approach for spatial layout of land use and roads in urban communities. (Nature Computational Science)
https://rdcu.be/dlRPZ
MIT License
184 stars 37 forks source link

rban_planning.envs.city.InfeasibleActionError: Infeasible action (*) when the mask is ([False False False ... False False False]) #4

Closed lpffernando closed 11 months ago

lpffernando commented 1 year ago

When I was training, everything was normal at the beginning, but later errors started to appear in the output and they became consistent after three occurrences. The Infeasible action IDs are 494、625、940 AND there was no model generated. AS BLOW: Process Process-15: Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/fernando/DRL-urban-planning/urban_planning/agents/urban_planning_agent.py", line 65, in sample_worker next_state, reward, done, info = self.env.step(action, self.thread_loggers[pid]) File "/home/fernando/DRL-urban-planning/urban_planning/envs/city.py", line 448, in step raise InfeasibleActionError(action, self._current_land_use_mask) urban_planning.envs.city.InfeasibleActionError: Infeasible action (625) when the mask is ([False False False ... False False False])

DavyMorgan commented 1 year ago

Can you provide more information? e.g., which instruction you are running? what data you are using? and your package version information?

lpffernando commented 1 year ago

THANKS, AND I am following the instructions in the documentation and using the provided files to run the command. The command is: python3 -m urban_planning.train --cfg dhm --global_seed 666

Package Version


absl-py 1.4.0 accelerate 0.17.1 aiohttp 3.8.4 aiosignal 1.3.1 anyio 3.6.2 appdirs 1.4.4 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 arrow 1.2.3 asttokens 2.2.1 astunparse 1.6.3 async-timeout 4.0.2 attrs 22.2.0 Automat 22.10.0 backcall 0.2.0 beautifulsoup4 4.11.2 bitsandbytes 0.37.1 bleach 6.0.0 blinker 1.4 branca 0.6.0 cachetools 5.3.1 certifi 2022.12.7 cffi 1.15.1 charset-normalizer 3.1.0 click 8.1.7 click-plugins 1.1.1 cligj 0.7.2 cmake 3.26.0 comm 0.1.2 command-not-found 0.3 constantly 15.1.0 contourpy 1.1.1 cpm-kernels 1.0.11 cryptography 41.0.1 cssselect 1.2.0 cycler 0.11.0 datasets 2.10.1 dbus-python 1.2.18 debugpy 1.6.6 decorator 5.1.1 defusedxml 0.7.1 dill 0.3.6 distro 1.7.0 distro-info 1.1build1 executing 1.2.0 fastjsonschema 2.16.3 filelock 3.10.0 Fiona 1.9.4.post1 flatbuffers 23.5.26 folium 0.14.0 fonttools 4.42.1 fqdn 1.5.1 frozenlist 1.3.3 fsspec 2023.3.0 gast 0.4.0 geopandas 0.11.1 google-auth 2.23.0 google-auth-oauthlib 1.0.0 google-pasta 0.2.0 grpcio 1.58.0 h5py 3.9.0 httplib2 0.20.2 huggingface-hub 0.13.2 hyperlink 21.0.0 icetk 0.0.4 idna 3.4 importlib-metadata 4.6.4 incremental 22.10.0 ipykernel 6.21.3 ipython 8.11.0 ipython-genutils 0.2.0 ipywidgets 8.0.4 isoduration 20.11.0 jedi 0.18.2 jeepney 0.7.1 Jinja2 3.1.2 jmespath 1.0.1 joblib 1.3.2 jsonpointer 2.3 jsonschema 4.17.3 jupyter 1.0.0 jupyter_client 8.0.3 jupyter-console 6.6.3 jupyter_core 5.3.0 jupyter-events 0.6.3 jupyter_server 2.5.0 jupyter_server_terminals 0.4.4 jupyterlab-pygments 0.2.2 jupyterlab-widgets 3.0.5 keras 2.13.1 keyring 23.5.0 kiwisolver 1.4.5 launchpadlib 1.10.16 lazr.restfulclient 0.14.4 lazr.uri 1.0.6 libclang 16.0.6 libpysal 4.7.0 lit 15.0.7 lxml 4.9.2 Mako 1.2.4 mapclassify 2.6.0 Markdown 3.4.4 markdown-it-py 2.2.0 MarkupSafe 2.1.2 matplotlib 3.8.0 matplotlib-inline 0.1.6 mdurl 0.1.2 meshio 5.3.4 mistune 2.0.5 momepy 0.5.4 more-itertools 8.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.14 nbclassic 0.5.3 nbclient 0.7.2 nbconvert 7.2.10 nbformat 5.7.3 nest-asyncio 1.5.6 netifaces 0.11.0 networkx 3.0 notebook 6.5.3 notebook_shim 0.2.2 numpy 1.24.2 nvidia-cublas-cu11 11.10.3.66 nvidia-cuda-cupti-cu11 11.7.101 nvidia-cuda-nvrtc-cu11 11.7.99 nvidia-cuda-runtime-cu11 11.7.99 nvidia-cudnn-cu11 8.5.0.96 nvidia-cufft-cu11 10.9.0.58 nvidia-curand-cu11 10.2.10.91 nvidia-cusolver-cu11 11.4.0.1 nvidia-cusparse-cu11 11.7.4.91 nvidia-nccl-cu11 2.14.3 nvidia-nvtx-cu11 11.7.91 oauthlib 3.2.0 opt-einsum 3.3.0 osmnx 1.2.2 packaging 23.0 pandas 1.5.3 pandocfilters 1.5.0 parsel 1.8.1 parso 0.8.3 peft 0.3.0.dev0 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.4.0 pip 23.2.1 platformdirs 3.1.1 prometheus-client 0.16.0 prompt-toolkit 3.0.38 protobuf 4.24.3 psutil 5.9.4 ptyprocess 0.7.0 pure-eval 0.2.2 pyarrow 11.0.0 pyasn1 0.5.0 pyasn1-modules 0.3.0 pycparser 2.21 pycuda 2022.2.2 PyDispatcher 2.0.7 PyFoam 2022.9 pygeos 0.14 Pygments 2.14.0 PyGObject 3.42.1 PyJWT 2.3.0 pyOpenSSL 23.2.0 pyparsing 2.4.7 pyproj 3.6.0 pyrsistent 0.19.3 python-apt 2.4.0+ubuntu1 python-dateutil 2.8.2 python-json-logger 2.0.7 pytools 2023.1.1 pytz 2022.7.1 PyYAML 6.0.1 pyzmq 25.0.1 qtconsole 5.4.1 QtPy 2.3.0 queuelib 1.6.2 regex 2022.10.31 requests 2.28.2 requests-oauthlib 1.3.1 responses 0.18.0 rfc3339-validator 0.1.4 rfc3986-validator 0.1.1 rich 13.3.2 rsa 4.9 Rtree 1.0.1 scikit-learn 1.3.0 scipy 1.11.2 Scrapy 1.6.0 SecretStorage 3.3.1 Send2Trash 1.8.0 sentencepiece 0.1.97 service-identity 23.1.0 setproctitle 1.3.2 setuptools 59.5.0 Shapely 1.8.5.post1 six 1.16.0 sniffio 1.3.0 soupsieve 2.4 speedtest-cli 2.1.2 stack-data 0.6.2 sympy 1.11.1 systemd-python 234 tensorboard 2.13.0 tensorboard-data-server 0.7.1 tensorflow 2.13.0 tensorflow-estimator 2.13.0 tensorflow-io-gcs-filesystem 0.34.0 termcolor 2.3.0 terminado 0.17.1 threadpoolctl 3.2.0 tinycss2 1.2.1 tokenizers 0.13.2 torch 2.0.0+cu118 torch-tb-profiler 0.4.1 torchaudio 2.0.1+cu118 torchvision 0.15.1+cu118 tornado 6.2 tqdm 4.65.0 traitlets 5.9.0 transformers 4.27.1 triton 2.0.0 Twisted 22.10.0 typing_extensions 4.5.0 ubuntu-advantage-tools 8001 ufw 0.36.1 unattended-upgrades 0.1 uri-template 1.2.0 urllib3 1.25.11 w3lib 2.1.1 wadllib 1.3.6 wcwidth 0.2.6 webcolors 1.12 webencodings 0.5.1 websocket-client 1.5.1 Werkzeug 2.3.7 wheel 0.37.1 widgetsnbextension 4.0.5 wrapt 1.15.0 xxhash 3.2.0 yarl 1.8.2 zipp 1.0.0 zope.interface 6.0

lpffernando commented 1 year ago

Can you provide more information? e.g., which instruction you are running? what data you are using? and your package version information?

AND I AM running on WSL2 of windows 11

lpffernando commented 1 year ago

IT'S KIND OF the reason is the overflow of ACTION values.

102 1062 1216 1106 1037 1188 1252 2598 Process Process-5: Traceback (most recent call last): File "/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/fernando/DRL-urban-planning-main/urban_planning/agents/urban_planning_agent.py", line 65, in sample_worker next_state, reward, done, info = self.env.step(action, self.thread_loggers[pid]) File "/home/fernando/DRL-urban-planning-main/urban_planning/envs/city.py", line 448, in step if self._current_land_use_mask[action] == 0: IndexError: index 2598 is out of bounds for axis 0 with size 1664 1222 1143 1019 1137 1123 1036 1121 1235 1836 1075 1249 1178 1113

gdjmck commented 1 year ago

IT'S KIND OF the reason is the overflow of ACTION values.

102 1062 1216 1106 1037 1188 1252 2598 Process Process-5: Traceback (most recent call last): File "/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/fernando/DRL-urban-planning-main/urban_planning/agents/urban_planning_agent.py", line 65, in sample_worker next_state, reward, done, info = self.env.step(action, self.thread_loggers[pid]) File "/home/fernando/DRL-urban-planning-main/urban_planning/envs/city.py", line 448, in step if self._current_land_use_mask[action] == 0: IndexError: index 2598 is out of bounds for axis 0 with size 1664 1222 1143 1019 1137 1123 1036 1121 1235 1836 1075 1249 1178 1113

图片

I add some assertion in the forward() of the UrbanPlanningPolicy class, and find out that through sampling a action with the lowest posibility would be sampled which corresponds to the action out of range.

lpffernando commented 1 year ago

原因是操作值的溢出。 102 1062 1216 1106 1037 1188 1252 2598 Process Process-5:回溯(最近一次调用): 文件 “/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py”,第 314 行,在 self.run() _bootstrap 中 文件“/home/fernando/anaconda3/envs/DRL/lib/python3.10/multiprocessing/process.py”,第 108 行,运行中 self._target(*self._args, **self._kwargs) 文件 “/home/fernando/DRL-urban-planning-main/urban_planning/agents/urban_planning_agent.py”, 第 65 行,在 sample_worker next_state 中,奖励,完成,信息 = self.env.step(action, self.thread_loggers[pid]) 文件 “/home/fernando/DRL-urban-planning-main/urban_planning/envs/city.py”,第 448 行,如果 self._current_land_use_mask[action] == 0: 索引错误:索引 2598 超出轴 0 的范围,大小为 1664 1222 1143 1019 1137 1123 1036 1121 1235 1836 1075 1249 1178 1113

图片

我在 UrbanPlanningPolicy 类的 forward() 中添加了一些断言,并发现通过采样,将对可能性最低的操作进行采样,这与超出范围的操作相对应。

[2023-09-25 14:36:23,544] worker 13 finished episode 1. [2023-09-25 14:36:23,616] worker 5 finished episode 1. [2023-09-25 14:36:23,708] worker 19 finished episode 1. [2023-09-25 14:36:23,724] worker 14 finished episode 1. [2023-09-25 14:36:23,744] worker 6 finished episode 1. [2023-09-25 14:36:23,749] worker 12 finished episode 1. [2023-09-25 14:36:23,762] worker 0 finished episode 1. [2023-09-25 14:36:23,775] worker 7 finished episode 1. [2023-09-25 14:36:23,807] worker 4 finished episode 1. Process Process-14: Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/fernando/DRL-urban-planning/urban_planning/agents/urban_planning_agent.py", line 67, in sample_worker action = self.policy_net.select_action(state_var, use_mean_action).numpy().squeeze(0) File "/home/fernando/DRL-urban-planning/urban_planning/models/policy.py", line 78, in select_action land_use_dist, road_dist, stage = self.forward(x) File "/home/fernando/DRL-urban-planning/urban_planning/models/policy.py", line 61, in forward assert masked_land_use_logits[0,sample_action] > masked_land_use_logits.min() AssertionError [2023-09-25 14:36:26,702] worker 10 finished episode 2. [2023-09-25 14:36:26,814] worker 2 finished episode 2. [2023-09-25 14:36:26,889] worker 1 finished episode 2. [2023-09-25 14:36:26,917] worker 19 finished episode 2. [2023-09-25 14:36:26,926] worker 18 finished episode 2. [2023-09-25 14:36:26,959] worker 16 finished episode 2. [2023-09-25 14:36:26,967] worker 8 finished episode 2. [2023-09-25 14:36:27,015] worker 9 finished episode 2. [2023-09-25 14:36:27,098] worker 13 finished episode 2.

AND I print the value as below: print(f"value at (0, sample_action): {masked_land_use_logits[0, sample_action]}") print(f"min value of masked_land_use_logits: {masked_land_use_logits.min()}")

HERE is the result: value at (0, sample_action): -0.05345473438501358 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.05928034335374832 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.060999058187007904 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): 0.006120316684246063 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.06063757836818695 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.060999058187007904 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.04832091182470322 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.025311244651675224 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.003965239971876144 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.0014818795025348663 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.05041918158531189 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.06172984465956688 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.05180396884679794 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.06942874193191528 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.028974562883377075 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.025480464100837708 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.0692424550652504 min value of masked_land_use_logits: -4294967296.0 value at (0, sample_action): -0.028691623359918594 min value of masked_land_use_logits: -4294967296.0

boxbox-0427 commented 1 year ago

Have u ever tried to set the environment ?

os.environ["OMP_NUM_THREADS"] = "1"
print(os.environ.get("OMP_NUM_THREADS"))

Everything goes well after setting this env.

DavyMorgan commented 1 year ago

Have u ever tried to set the environment ?

os.environ["OMP_NUM_THREADS"] = "1"
print(os.environ.get("OMP_NUM_THREADS"))

Everything goes well after setting this env.

Thanks for pointing this out. The environment variable is actually important for multiprocessing and action sampling.

I think actions with probability -2.32 + 1 will never be sampled, and I haven't encountered them in my experiments. The resampling solution by @gdjmck is a nice workaround. BTW, I'm also wondering whether replacing -2.32 + 1 with torch.tensor(float('-inf')) can help fully address this issue.

boxbox-0427 commented 1 year ago

Have u ever tried to set the environment ?

os.environ["OMP_NUM_THREADS"] = "1"
print(os.environ.get("OMP_NUM_THREADS"))

Everything goes well after setting this env.

Thanks for pointing this out. The environment variable is actually important for multiprocessing and action sampling.

I think actions with probability -2.32 + 1 will never be sampled, and I haven't encountered them in my experiments. The resampling solution by @gdjmck is a nice workaround. BTW, I'm also wondering whether replacing -2.32 + 1 with torch.tensor(float('-inf')) can help fully address this issue.

We (@gdjmck and me) tried this method, however, this exception still appears.

But things changed when @gdjmck changed his pytorch version torch-2.0.0 into my torch version torch-1.13.0. So I decide to share my whole conda environment here which can run successfully:

name: urban
channels:
  - conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_kmp_llvm
  - attrs=23.1.0=pyh71513ae_1
  - blosc=1.21.5=h0f2a231_0
  - boost-cpp=1.78.0=h2c5509c_4
  - branca=0.6.0=pyhd8ed1ab_0
  - brotli=1.1.0=hd590300_0
  - brotli-bin=1.1.0=hd590300_0
  - brotli-python=1.1.0=py39h3d6467e_0
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.1=hd590300_0
  - ca-certificates=2023.7.22=hbcca054_0
  - cairo=1.16.0=h0c91306_1017
  - certifi=2023.7.22=pyhd8ed1ab_0
  - cfitsio=4.3.0=hbdc6101_0
  - charset-normalizer=3.2.0=pyhd8ed1ab_0
  - click=8.1.7=unix_pyh707e725_0
  - click-plugins=1.1.1=py_0
  - cligj=0.7.2=pyhd8ed1ab_1
  - contourpy=1.1.1=py39h7633fee_1
  - cycler=0.11.0=pyhd8ed1ab_0
  - expat=2.5.0=hcb278e6_1
  - fiona=1.9.4=py39h587696a_0
  - folium=0.14.0=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.2=h14ed4e7_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.42.1=py39hd1e30aa_0
  - freetype=2.12.1=h267a509_2
  - freexl=2.0.0=h743c826_0
  - gdal=3.7.2=py39h41b90d8_4
  - geopandas=0.14.0=pyhd8ed1ab_0
  - geopandas-base=0.14.0=pyha770c72_0
  - geos=3.12.0=h59595ed_0
  - geotiff=1.7.1=hee599c5_13
  - gettext=0.21.1=h27087fc_0
  - giflib=5.2.1=h0b41bf4_3
  - hdf4=4.2.15=h501b40f_6
  - hdf5=1.14.2=nompi_h4f84152_100
  - icu=73.2=h59595ed_0
  - idna=3.4=pyhd8ed1ab_0
  - importlib-metadata=6.8.0=pyha770c72_0
  - importlib-resources=6.1.0=pyhd8ed1ab_0
  - importlib_resources=6.1.0=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - joblib=1.3.2=pyhd8ed1ab_0
  - json-c=0.17=h7ab15ed_0
  - kealib=1.5.1=hcd42e92_5
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.5=py39h7633fee_1
  - krb5=1.21.2=h659d440_0
  - lcms2=2.15=h7f713cb_2
  - ld_impl_linux-64=2.38=h1181459_1
  - lerc=4.0.0=h27087fc_0
  - libaec=1.0.6=hcb278e6_1
  - libarchive=3.7.2=h039dbb9_0
  - libblas=3.9.0=18_linux64_openblas
  - libbrotlicommon=1.1.0=hd590300_0
  - libbrotlidec=1.1.0=hd590300_0
  - libbrotlienc=1.1.0=hd590300_0
  - libcblas=3.9.0=18_linux64_openblas
  - libcurl=8.3.0=hca28451_0
  - libdeflate=1.19=hd590300_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libexpat=2.5.0=hcb278e6_1
  - libffi=3.4.4=h6a678d5_0
  - libgcc-ng=13.2.0=h807b86a_2
  - libgdal=3.7.2=h17082cf_4
  - libgfortran-ng=13.2.0=h69a702a_2
  - libgfortran5=13.2.0=ha4646dd_2
  - libglib=2.78.0=hebfc3b9_0
  - libiconv=1.17=h166bdaf_0
  - libjpeg-turbo=2.1.5.1=hd590300_1
  - libkml=1.3.0=h37653c0_1015
  - liblapack=3.9.0=18_linux64_openblas
  - libnetcdf=4.9.2=nompi_h80fb2b6_112
  - libnghttp2=1.52.0=h61bc06f_0
  - libnsl=2.0.0=h7f98852_0
  - libopenblas=0.3.24=pthreads_h413a1c8_0
  - libpng=1.6.39=h753d276_0
  - libpq=16.0=hfc447b1_0
  - librttopo=1.1.0=hb58d41b_14
  - libspatialindex=1.9.3=h9c3ff4c_4
  - libspatialite=5.1.0=h090f1da_0
  - libsqlite=3.43.0=h2797004_0
  - libssh2=1.11.0=h0841786_0
  - libstdcxx-ng=13.2.0=h7e041cc_2
  - libtiff=4.6.0=h29866fb_1
  - libuuid=2.38.1=h0b41bf4_0
  - libwebp-base=1.3.2=hd590300_0
  - libxcb=1.15=h0b41bf4_0
  - libxml2=2.11.5=h232c23b_1
  - libzip=1.10.1=h2629f0a_3
  - libzlib=1.2.13=hd590300_5
  - llvm-openmp=16.0.6=h4dfa4b3_0
  - lz4-c=1.9.4=hcb278e6_0
  - lzo=2.10=h516909a_1000
  - mapclassify=2.5.0=pyhd8ed1ab_1
  - markupsafe=2.1.3=py39hd1e30aa_1
  - matplotlib-base=3.8.0=py39he9076e7_1
  - minizip=4.0.1=h0ab5242_4
  - munch=4.0.0=pyhd8ed1ab_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - ncurses=6.4=h6a678d5_0
  - networkx=3.1=pyhd8ed1ab_0
  - nspr=4.35=h27087fc_0
  - nss=3.92=h1d7d5a4_0
  - numpy=1.26.0=py39h474f0d3_0
  - openjpeg=2.5.0=h488ebb8_3
  - openssl=3.1.3=hd590300_0
  - packaging=23.1=pyhd8ed1ab_0
  - pcre2=10.40=hc3806b6_0
  - pillow=10.0.1=py39h444a776_1
  - pip=23.2.1=py39h06a4308_0
  - pixman=0.40.0=h36c2ea0_0
  - poppler=23.08.0=ha962622_1
  - poppler-data=0.4.12=hd8ed1ab_0
  - postgresql=16.0=h8972f4a_0
  - proj=9.3.0=h1d62c97_1
  - pthread-stubs=0.4=h36c2ea0_1001
  - pyparsing=3.1.1=pyhd8ed1ab_0
  - pyproj=3.6.1=py39hce394fd_1
  - pysocks=1.7.1=pyha2e5f31_6
  - python=3.9.18=h955ad1f_0
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python-tzdata=2023.3=pyhd8ed1ab_0
  - python_abi=3.9=2_cp39
  - pytz=2023.3.post1=pyhd8ed1ab_0
  - readline=8.2=h5eee18b_0
  - requests=2.31.0=pyhd8ed1ab_0
  - rtree=1.0.1=py39hb102c33_3
  - scikit-learn=1.3.1=py39ha22ef79_0
  - scipy=1.11.2=py39h474f0d3_1
  - setuptools=68.0.0=py39h06a4308_0
  - shapely=2.0.1=py39h1bc45ef_2
  - six=1.16.0=pyh6c4a22f_0
  - snappy=1.1.10=h9fff704_0
  - sqlite=3.41.2=h5eee18b_0
  - threadpoolctl=3.2.0=pyha21a80b_0
  - tiledb=2.16.3=hf0b6e87_3
  - tk=8.6.12=h1ccaba5_0
  - tzcode=2023c=h0b41bf4_0
  - tzdata=2023c=h04d1e81_0
  - unicodedata2=15.0.0=py39hd1e30aa_1
  - wheel=0.38.4=py39h06a4308_0
  - xerces-c=3.2.4=hac6953d_3
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.1.1=hd590300_0
  - xorg-libsm=1.2.4=h7391055_0
  - xorg-libx11=1.8.6=h8ee46fc_0
  - xorg-libxau=1.0.11=hd590300_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h0b41bf4_2
  - xorg-libxrender=0.9.11=hd590300_0
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h0b41bf4_1003
  - xorg-xproto=7.0.31=h7f98852_1007
  - xyzservices=2023.7.0=pyhd8ed1ab_0
  - xz=5.4.2=h5eee18b_0
  - zipp=3.17.0=pyhd8ed1ab_0
  - zlib=1.2.13=hd590300_5
  - zstd=1.5.5=hfc55251_0
  - pip:
      - absl-py==2.0.0
      - anyio==4.0.0
      - argon2-cffi==23.1.0
      - argon2-cffi-bindings==21.2.0
      - arrow==1.2.3
      - asttokens==2.4.0
      - async-lru==2.0.4
      - babel==2.12.1
      - backcall==0.2.0
      - beautifulsoup4==4.12.2
      - bleach==6.0.0
      - cachetools==5.3.1
      - cffi==1.15.1
      - comm==0.1.4
      - debugpy==1.8.0
      - decorator==5.1.1
      - defusedxml==0.7.1
      - exceptiongroup==1.1.3
      - executing==1.2.0
      - fastjsonschema==2.18.0
      - fqdn==1.5.1
      - google-auth==2.23.0
      - google-auth-oauthlib==1.0.0
      - grpcio==1.58.0
      - ipykernel==6.25.2
      - ipython==8.15.0
      - isoduration==20.11.0
      - jedi==0.19.0
      - json5==0.9.14
      - jsonpointer==2.4
      - jsonschema==4.19.1
      - jsonschema-specifications==2023.7.1
      - jupyter-client==8.3.1
      - jupyter-core==5.3.1
      - jupyter-events==0.7.0
      - jupyter-lsp==2.2.0
      - jupyter-server==2.7.3
      - jupyter-server-terminals==0.4.4
      - jupyterlab==4.0.6
      - jupyterlab-pygments==0.2.2
      - jupyterlab-server==2.25.0
      - libpysal==4.7.0
      - markdown==3.4.4
      - matplotlib-inline==0.1.6
      - mistune==3.0.1
      - momepy==0.6.0
      - nbclient==0.8.0
      - nbconvert==7.8.0
      - nbformat==5.9.2
      - nest-asyncio==1.5.8
      - notebook-shim==0.2.3
      - oauthlib==3.2.2
      - overrides==7.4.0
      - pandas==1.5.3
      - pandocfilters==1.5.0
      - parso==0.8.3
      - pexpect==4.8.0
      - pickleshare==0.7.5
      - platformdirs==3.10.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.39
      - protobuf==4.24.3
      - psutil==5.9.5
      - ptyprocess==0.7.0
      - pure-eval==0.2.2
      - pyasn1==0.5.0
      - pyasn1-modules==0.3.0
      - pycparser==2.21
      - pygments==2.16.1
      - python-json-logger==2.0.7
      - pyyaml==6.0.1
      - pyzmq==25.1.1
      - referencing==0.30.2
      - requests-oauthlib==1.3.1
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rpds-py==0.10.3
      - rsa==4.8
      - send2trash==1.8.2
      - setproctitle==1.3.2
      - sniffio==1.3.0
      - soupsieve==2.5
      - stack-data==0.6.2
      - tensorboard==2.14.0
      - tensorboard-data-server==0.7.1
      - terminado==0.17.1
      - tinycss2==1.2.1
      - tomli==2.0.1
      - torch==1.13.0+cu117
      - tornado==6.3.3
      - tqdm==4.66.1
      - traitlets==5.10.0
      - typing-extensions==4.8.0
      - uri-template==1.3.0
      - urllib3==1.26.16
      - wcwidth==0.2.6
      - webcolors==1.13
      - webencodings==0.5.1
      - websocket-client==1.6.3
      - werkzeug==2.3.7
boxbox-0427 commented 1 year ago

Occasionally,an exception named TopologyException would occur. But, it seems there is no effect. Everything goes well.

TopologyException

lpffernando commented 1 year ago

Have u ever tried to set the environment ?

os.environ["OMP_NUM_THREADS"] = "1"
print(os.environ.get("OMP_NUM_THREADS"))

Everything goes well after setting this env.

Thanks for pointing this out. The environment variable is actually important for multiprocessing and action sampling. I think actions with probability -2.32 + 1 will never be sampled, and I haven't encountered them in my experiments. The resampling solution by @gdjmck is a nice workaround. BTW, I'm also wondering whether replacing -2.32 + 1 with torch.tensor(float('-inf')) can help fully address this issue.

We (@gdjmck and me) tried this method, however, this exception still appears.

But things changed when @gdjmck changed his pytorch version torch-2.0.0 into my torch version torch-1.13.0. So I decide to share my whole conda environment here which can run successfully:

name: urban
channels:
  - conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_kmp_llvm
  - attrs=23.1.0=pyh71513ae_1
  - blosc=1.21.5=h0f2a231_0
  - boost-cpp=1.78.0=h2c5509c_4
  - branca=0.6.0=pyhd8ed1ab_0
  - brotli=1.1.0=hd590300_0
  - brotli-bin=1.1.0=hd590300_0
  - brotli-python=1.1.0=py39h3d6467e_0
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.1=hd590300_0
  - ca-certificates=2023.7.22=hbcca054_0
  - cairo=1.16.0=h0c91306_1017
  - certifi=2023.7.22=pyhd8ed1ab_0
  - cfitsio=4.3.0=hbdc6101_0
  - charset-normalizer=3.2.0=pyhd8ed1ab_0
  - click=8.1.7=unix_pyh707e725_0
  - click-plugins=1.1.1=py_0
  - cligj=0.7.2=pyhd8ed1ab_1
  - contourpy=1.1.1=py39h7633fee_1
  - cycler=0.11.0=pyhd8ed1ab_0
  - expat=2.5.0=hcb278e6_1
  - fiona=1.9.4=py39h587696a_0
  - folium=0.14.0=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.2=h14ed4e7_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.42.1=py39hd1e30aa_0
  - freetype=2.12.1=h267a509_2
  - freexl=2.0.0=h743c826_0
  - gdal=3.7.2=py39h41b90d8_4
  - geopandas=0.14.0=pyhd8ed1ab_0
  - geopandas-base=0.14.0=pyha770c72_0
  - geos=3.12.0=h59595ed_0
  - geotiff=1.7.1=hee599c5_13
  - gettext=0.21.1=h27087fc_0
  - giflib=5.2.1=h0b41bf4_3
  - hdf4=4.2.15=h501b40f_6
  - hdf5=1.14.2=nompi_h4f84152_100
  - icu=73.2=h59595ed_0
  - idna=3.4=pyhd8ed1ab_0
  - importlib-metadata=6.8.0=pyha770c72_0
  - importlib-resources=6.1.0=pyhd8ed1ab_0
  - importlib_resources=6.1.0=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - joblib=1.3.2=pyhd8ed1ab_0
  - json-c=0.17=h7ab15ed_0
  - kealib=1.5.1=hcd42e92_5
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.5=py39h7633fee_1
  - krb5=1.21.2=h659d440_0
  - lcms2=2.15=h7f713cb_2
  - ld_impl_linux-64=2.38=h1181459_1
  - lerc=4.0.0=h27087fc_0
  - libaec=1.0.6=hcb278e6_1
  - libarchive=3.7.2=h039dbb9_0
  - libblas=3.9.0=18_linux64_openblas
  - libbrotlicommon=1.1.0=hd590300_0
  - libbrotlidec=1.1.0=hd590300_0
  - libbrotlienc=1.1.0=hd590300_0
  - libcblas=3.9.0=18_linux64_openblas
  - libcurl=8.3.0=hca28451_0
  - libdeflate=1.19=hd590300_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libexpat=2.5.0=hcb278e6_1
  - libffi=3.4.4=h6a678d5_0
  - libgcc-ng=13.2.0=h807b86a_2
  - libgdal=3.7.2=h17082cf_4
  - libgfortran-ng=13.2.0=h69a702a_2
  - libgfortran5=13.2.0=ha4646dd_2
  - libglib=2.78.0=hebfc3b9_0
  - libiconv=1.17=h166bdaf_0
  - libjpeg-turbo=2.1.5.1=hd590300_1
  - libkml=1.3.0=h37653c0_1015
  - liblapack=3.9.0=18_linux64_openblas
  - libnetcdf=4.9.2=nompi_h80fb2b6_112
  - libnghttp2=1.52.0=h61bc06f_0
  - libnsl=2.0.0=h7f98852_0
  - libopenblas=0.3.24=pthreads_h413a1c8_0
  - libpng=1.6.39=h753d276_0
  - libpq=16.0=hfc447b1_0
  - librttopo=1.1.0=hb58d41b_14
  - libspatialindex=1.9.3=h9c3ff4c_4
  - libspatialite=5.1.0=h090f1da_0
  - libsqlite=3.43.0=h2797004_0
  - libssh2=1.11.0=h0841786_0
  - libstdcxx-ng=13.2.0=h7e041cc_2
  - libtiff=4.6.0=h29866fb_1
  - libuuid=2.38.1=h0b41bf4_0
  - libwebp-base=1.3.2=hd590300_0
  - libxcb=1.15=h0b41bf4_0
  - libxml2=2.11.5=h232c23b_1
  - libzip=1.10.1=h2629f0a_3
  - libzlib=1.2.13=hd590300_5
  - llvm-openmp=16.0.6=h4dfa4b3_0
  - lz4-c=1.9.4=hcb278e6_0
  - lzo=2.10=h516909a_1000
  - mapclassify=2.5.0=pyhd8ed1ab_1
  - markupsafe=2.1.3=py39hd1e30aa_1
  - matplotlib-base=3.8.0=py39he9076e7_1
  - minizip=4.0.1=h0ab5242_4
  - munch=4.0.0=pyhd8ed1ab_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - ncurses=6.4=h6a678d5_0
  - networkx=3.1=pyhd8ed1ab_0
  - nspr=4.35=h27087fc_0
  - nss=3.92=h1d7d5a4_0
  - numpy=1.26.0=py39h474f0d3_0
  - openjpeg=2.5.0=h488ebb8_3
  - openssl=3.1.3=hd590300_0
  - packaging=23.1=pyhd8ed1ab_0
  - pcre2=10.40=hc3806b6_0
  - pillow=10.0.1=py39h444a776_1
  - pip=23.2.1=py39h06a4308_0
  - pixman=0.40.0=h36c2ea0_0
  - poppler=23.08.0=ha962622_1
  - poppler-data=0.4.12=hd8ed1ab_0
  - postgresql=16.0=h8972f4a_0
  - proj=9.3.0=h1d62c97_1
  - pthread-stubs=0.4=h36c2ea0_1001
  - pyparsing=3.1.1=pyhd8ed1ab_0
  - pyproj=3.6.1=py39hce394fd_1
  - pysocks=1.7.1=pyha2e5f31_6
  - python=3.9.18=h955ad1f_0
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python-tzdata=2023.3=pyhd8ed1ab_0
  - python_abi=3.9=2_cp39
  - pytz=2023.3.post1=pyhd8ed1ab_0
  - readline=8.2=h5eee18b_0
  - requests=2.31.0=pyhd8ed1ab_0
  - rtree=1.0.1=py39hb102c33_3
  - scikit-learn=1.3.1=py39ha22ef79_0
  - scipy=1.11.2=py39h474f0d3_1
  - setuptools=68.0.0=py39h06a4308_0
  - shapely=2.0.1=py39h1bc45ef_2
  - six=1.16.0=pyh6c4a22f_0
  - snappy=1.1.10=h9fff704_0
  - sqlite=3.41.2=h5eee18b_0
  - threadpoolctl=3.2.0=pyha21a80b_0
  - tiledb=2.16.3=hf0b6e87_3
  - tk=8.6.12=h1ccaba5_0
  - tzcode=2023c=h0b41bf4_0
  - tzdata=2023c=h04d1e81_0
  - unicodedata2=15.0.0=py39hd1e30aa_1
  - wheel=0.38.4=py39h06a4308_0
  - xerces-c=3.2.4=hac6953d_3
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.1.1=hd590300_0
  - xorg-libsm=1.2.4=h7391055_0
  - xorg-libx11=1.8.6=h8ee46fc_0
  - xorg-libxau=1.0.11=hd590300_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h0b41bf4_2
  - xorg-libxrender=0.9.11=hd590300_0
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h0b41bf4_1003
  - xorg-xproto=7.0.31=h7f98852_1007
  - xyzservices=2023.7.0=pyhd8ed1ab_0
  - xz=5.4.2=h5eee18b_0
  - zipp=3.17.0=pyhd8ed1ab_0
  - zlib=1.2.13=hd590300_5
  - zstd=1.5.5=hfc55251_0
  - pip:
      - absl-py==2.0.0
      - anyio==4.0.0
      - argon2-cffi==23.1.0
      - argon2-cffi-bindings==21.2.0
      - arrow==1.2.3
      - asttokens==2.4.0
      - async-lru==2.0.4
      - babel==2.12.1
      - backcall==0.2.0
      - beautifulsoup4==4.12.2
      - bleach==6.0.0
      - cachetools==5.3.1
      - cffi==1.15.1
      - comm==0.1.4
      - debugpy==1.8.0
      - decorator==5.1.1
      - defusedxml==0.7.1
      - exceptiongroup==1.1.3
      - executing==1.2.0
      - fastjsonschema==2.18.0
      - fqdn==1.5.1
      - google-auth==2.23.0
      - google-auth-oauthlib==1.0.0
      - grpcio==1.58.0
      - ipykernel==6.25.2
      - ipython==8.15.0
      - isoduration==20.11.0
      - jedi==0.19.0
      - json5==0.9.14
      - jsonpointer==2.4
      - jsonschema==4.19.1
      - jsonschema-specifications==2023.7.1
      - jupyter-client==8.3.1
      - jupyter-core==5.3.1
      - jupyter-events==0.7.0
      - jupyter-lsp==2.2.0
      - jupyter-server==2.7.3
      - jupyter-server-terminals==0.4.4
      - jupyterlab==4.0.6
      - jupyterlab-pygments==0.2.2
      - jupyterlab-server==2.25.0
      - libpysal==4.7.0
      - markdown==3.4.4
      - matplotlib-inline==0.1.6
      - mistune==3.0.1
      - momepy==0.6.0
      - nbclient==0.8.0
      - nbconvert==7.8.0
      - nbformat==5.9.2
      - nest-asyncio==1.5.8
      - notebook-shim==0.2.3
      - oauthlib==3.2.2
      - overrides==7.4.0
      - pandas==1.5.3
      - pandocfilters==1.5.0
      - parso==0.8.3
      - pexpect==4.8.0
      - pickleshare==0.7.5
      - platformdirs==3.10.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.39
      - protobuf==4.24.3
      - psutil==5.9.5
      - ptyprocess==0.7.0
      - pure-eval==0.2.2
      - pyasn1==0.5.0
      - pyasn1-modules==0.3.0
      - pycparser==2.21
      - pygments==2.16.1
      - python-json-logger==2.0.7
      - pyyaml==6.0.1
      - pyzmq==25.1.1
      - referencing==0.30.2
      - requests-oauthlib==1.3.1
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rpds-py==0.10.3
      - rsa==4.8
      - send2trash==1.8.2
      - setproctitle==1.3.2
      - sniffio==1.3.0
      - soupsieve==2.5
      - stack-data==0.6.2
      - tensorboard==2.14.0
      - tensorboard-data-server==0.7.1
      - terminado==0.17.1
      - tinycss2==1.2.1
      - tomli==2.0.1
      - torch==1.13.0+cu117
      - tornado==6.3.3
      - tqdm==4.66.1
      - traitlets==5.10.0
      - typing-extensions==4.8.0
      - uri-template==1.3.0
      - urllib3==1.26.16
      - wcwidth==0.2.6
      - webcolors==1.13
      - webencodings==0.5.1
      - websocket-client==1.6.3
      - werkzeug==2.3.7

IT worked!! WHEN I change torch-2.0.0 into torch-1.13.0 , many thx.

DavyMorgan commented 1 year ago

Thank you very much, guys. I have updated requirements.txt and README (commit1, commit2).

Have u ever tried to set the environment ?

os.environ["OMP_NUM_THREADS"] = "1"
print(os.environ.get("OMP_NUM_THREADS"))

Everything goes well after setting this env.

Thanks for pointing this out. The environment variable is actually important for multiprocessing and action sampling. I think actions with probability -2.32 + 1 will never be sampled, and I haven't encountered them in my experiments. The resampling solution by @gdjmck is a nice workaround. BTW, I'm also wondering whether replacing -2.32 + 1 with torch.tensor(float('-inf')) can help fully address this issue.

We (@gdjmck and me) tried this method, however, this exception still appears. But things changed when @gdjmck changed his pytorch version torch-2.0.0 into my torch version torch-1.13.0. So I decide to share my whole conda environment here which can run successfully:

name: urban
channels:
  - conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_kmp_llvm
  - attrs=23.1.0=pyh71513ae_1
  - blosc=1.21.5=h0f2a231_0
  - boost-cpp=1.78.0=h2c5509c_4
  - branca=0.6.0=pyhd8ed1ab_0
  - brotli=1.1.0=hd590300_0
  - brotli-bin=1.1.0=hd590300_0
  - brotli-python=1.1.0=py39h3d6467e_0
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.1=hd590300_0
  - ca-certificates=2023.7.22=hbcca054_0
  - cairo=1.16.0=h0c91306_1017
  - certifi=2023.7.22=pyhd8ed1ab_0
  - cfitsio=4.3.0=hbdc6101_0
  - charset-normalizer=3.2.0=pyhd8ed1ab_0
  - click=8.1.7=unix_pyh707e725_0
  - click-plugins=1.1.1=py_0
  - cligj=0.7.2=pyhd8ed1ab_1
  - contourpy=1.1.1=py39h7633fee_1
  - cycler=0.11.0=pyhd8ed1ab_0
  - expat=2.5.0=hcb278e6_1
  - fiona=1.9.4=py39h587696a_0
  - folium=0.14.0=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.2=h14ed4e7_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.42.1=py39hd1e30aa_0
  - freetype=2.12.1=h267a509_2
  - freexl=2.0.0=h743c826_0
  - gdal=3.7.2=py39h41b90d8_4
  - geopandas=0.14.0=pyhd8ed1ab_0
  - geopandas-base=0.14.0=pyha770c72_0
  - geos=3.12.0=h59595ed_0
  - geotiff=1.7.1=hee599c5_13
  - gettext=0.21.1=h27087fc_0
  - giflib=5.2.1=h0b41bf4_3
  - hdf4=4.2.15=h501b40f_6
  - hdf5=1.14.2=nompi_h4f84152_100
  - icu=73.2=h59595ed_0
  - idna=3.4=pyhd8ed1ab_0
  - importlib-metadata=6.8.0=pyha770c72_0
  - importlib-resources=6.1.0=pyhd8ed1ab_0
  - importlib_resources=6.1.0=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - joblib=1.3.2=pyhd8ed1ab_0
  - json-c=0.17=h7ab15ed_0
  - kealib=1.5.1=hcd42e92_5
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.5=py39h7633fee_1
  - krb5=1.21.2=h659d440_0
  - lcms2=2.15=h7f713cb_2
  - ld_impl_linux-64=2.38=h1181459_1
  - lerc=4.0.0=h27087fc_0
  - libaec=1.0.6=hcb278e6_1
  - libarchive=3.7.2=h039dbb9_0
  - libblas=3.9.0=18_linux64_openblas
  - libbrotlicommon=1.1.0=hd590300_0
  - libbrotlidec=1.1.0=hd590300_0
  - libbrotlienc=1.1.0=hd590300_0
  - libcblas=3.9.0=18_linux64_openblas
  - libcurl=8.3.0=hca28451_0
  - libdeflate=1.19=hd590300_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libexpat=2.5.0=hcb278e6_1
  - libffi=3.4.4=h6a678d5_0
  - libgcc-ng=13.2.0=h807b86a_2
  - libgdal=3.7.2=h17082cf_4
  - libgfortran-ng=13.2.0=h69a702a_2
  - libgfortran5=13.2.0=ha4646dd_2
  - libglib=2.78.0=hebfc3b9_0
  - libiconv=1.17=h166bdaf_0
  - libjpeg-turbo=2.1.5.1=hd590300_1
  - libkml=1.3.0=h37653c0_1015
  - liblapack=3.9.0=18_linux64_openblas
  - libnetcdf=4.9.2=nompi_h80fb2b6_112
  - libnghttp2=1.52.0=h61bc06f_0
  - libnsl=2.0.0=h7f98852_0
  - libopenblas=0.3.24=pthreads_h413a1c8_0
  - libpng=1.6.39=h753d276_0
  - libpq=16.0=hfc447b1_0
  - librttopo=1.1.0=hb58d41b_14
  - libspatialindex=1.9.3=h9c3ff4c_4
  - libspatialite=5.1.0=h090f1da_0
  - libsqlite=3.43.0=h2797004_0
  - libssh2=1.11.0=h0841786_0
  - libstdcxx-ng=13.2.0=h7e041cc_2
  - libtiff=4.6.0=h29866fb_1
  - libuuid=2.38.1=h0b41bf4_0
  - libwebp-base=1.3.2=hd590300_0
  - libxcb=1.15=h0b41bf4_0
  - libxml2=2.11.5=h232c23b_1
  - libzip=1.10.1=h2629f0a_3
  - libzlib=1.2.13=hd590300_5
  - llvm-openmp=16.0.6=h4dfa4b3_0
  - lz4-c=1.9.4=hcb278e6_0
  - lzo=2.10=h516909a_1000
  - mapclassify=2.5.0=pyhd8ed1ab_1
  - markupsafe=2.1.3=py39hd1e30aa_1
  - matplotlib-base=3.8.0=py39he9076e7_1
  - minizip=4.0.1=h0ab5242_4
  - munch=4.0.0=pyhd8ed1ab_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - ncurses=6.4=h6a678d5_0
  - networkx=3.1=pyhd8ed1ab_0
  - nspr=4.35=h27087fc_0
  - nss=3.92=h1d7d5a4_0
  - numpy=1.26.0=py39h474f0d3_0
  - openjpeg=2.5.0=h488ebb8_3
  - openssl=3.1.3=hd590300_0
  - packaging=23.1=pyhd8ed1ab_0
  - pcre2=10.40=hc3806b6_0
  - pillow=10.0.1=py39h444a776_1
  - pip=23.2.1=py39h06a4308_0
  - pixman=0.40.0=h36c2ea0_0
  - poppler=23.08.0=ha962622_1
  - poppler-data=0.4.12=hd8ed1ab_0
  - postgresql=16.0=h8972f4a_0
  - proj=9.3.0=h1d62c97_1
  - pthread-stubs=0.4=h36c2ea0_1001
  - pyparsing=3.1.1=pyhd8ed1ab_0
  - pyproj=3.6.1=py39hce394fd_1
  - pysocks=1.7.1=pyha2e5f31_6
  - python=3.9.18=h955ad1f_0
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python-tzdata=2023.3=pyhd8ed1ab_0
  - python_abi=3.9=2_cp39
  - pytz=2023.3.post1=pyhd8ed1ab_0
  - readline=8.2=h5eee18b_0
  - requests=2.31.0=pyhd8ed1ab_0
  - rtree=1.0.1=py39hb102c33_3
  - scikit-learn=1.3.1=py39ha22ef79_0
  - scipy=1.11.2=py39h474f0d3_1
  - setuptools=68.0.0=py39h06a4308_0
  - shapely=2.0.1=py39h1bc45ef_2
  - six=1.16.0=pyh6c4a22f_0
  - snappy=1.1.10=h9fff704_0
  - sqlite=3.41.2=h5eee18b_0
  - threadpoolctl=3.2.0=pyha21a80b_0
  - tiledb=2.16.3=hf0b6e87_3
  - tk=8.6.12=h1ccaba5_0
  - tzcode=2023c=h0b41bf4_0
  - tzdata=2023c=h04d1e81_0
  - unicodedata2=15.0.0=py39hd1e30aa_1
  - wheel=0.38.4=py39h06a4308_0
  - xerces-c=3.2.4=hac6953d_3
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.1.1=hd590300_0
  - xorg-libsm=1.2.4=h7391055_0
  - xorg-libx11=1.8.6=h8ee46fc_0
  - xorg-libxau=1.0.11=hd590300_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h0b41bf4_2
  - xorg-libxrender=0.9.11=hd590300_0
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h0b41bf4_1003
  - xorg-xproto=7.0.31=h7f98852_1007
  - xyzservices=2023.7.0=pyhd8ed1ab_0
  - xz=5.4.2=h5eee18b_0
  - zipp=3.17.0=pyhd8ed1ab_0
  - zlib=1.2.13=hd590300_5
  - zstd=1.5.5=hfc55251_0
  - pip:
      - absl-py==2.0.0
      - anyio==4.0.0
      - argon2-cffi==23.1.0
      - argon2-cffi-bindings==21.2.0
      - arrow==1.2.3
      - asttokens==2.4.0
      - async-lru==2.0.4
      - babel==2.12.1
      - backcall==0.2.0
      - beautifulsoup4==4.12.2
      - bleach==6.0.0
      - cachetools==5.3.1
      - cffi==1.15.1
      - comm==0.1.4
      - debugpy==1.8.0
      - decorator==5.1.1
      - defusedxml==0.7.1
      - exceptiongroup==1.1.3
      - executing==1.2.0
      - fastjsonschema==2.18.0
      - fqdn==1.5.1
      - google-auth==2.23.0
      - google-auth-oauthlib==1.0.0
      - grpcio==1.58.0
      - ipykernel==6.25.2
      - ipython==8.15.0
      - isoduration==20.11.0
      - jedi==0.19.0
      - json5==0.9.14
      - jsonpointer==2.4
      - jsonschema==4.19.1
      - jsonschema-specifications==2023.7.1
      - jupyter-client==8.3.1
      - jupyter-core==5.3.1
      - jupyter-events==0.7.0
      - jupyter-lsp==2.2.0
      - jupyter-server==2.7.3
      - jupyter-server-terminals==0.4.4
      - jupyterlab==4.0.6
      - jupyterlab-pygments==0.2.2
      - jupyterlab-server==2.25.0
      - libpysal==4.7.0
      - markdown==3.4.4
      - matplotlib-inline==0.1.6
      - mistune==3.0.1
      - momepy==0.6.0
      - nbclient==0.8.0
      - nbconvert==7.8.0
      - nbformat==5.9.2
      - nest-asyncio==1.5.8
      - notebook-shim==0.2.3
      - oauthlib==3.2.2
      - overrides==7.4.0
      - pandas==1.5.3
      - pandocfilters==1.5.0
      - parso==0.8.3
      - pexpect==4.8.0
      - pickleshare==0.7.5
      - platformdirs==3.10.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.39
      - protobuf==4.24.3
      - psutil==5.9.5
      - ptyprocess==0.7.0
      - pure-eval==0.2.2
      - pyasn1==0.5.0
      - pyasn1-modules==0.3.0
      - pycparser==2.21
      - pygments==2.16.1
      - python-json-logger==2.0.7
      - pyyaml==6.0.1
      - pyzmq==25.1.1
      - referencing==0.30.2
      - requests-oauthlib==1.3.1
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rpds-py==0.10.3
      - rsa==4.8
      - send2trash==1.8.2
      - setproctitle==1.3.2
      - sniffio==1.3.0
      - soupsieve==2.5
      - stack-data==0.6.2
      - tensorboard==2.14.0
      - tensorboard-data-server==0.7.1
      - terminado==0.17.1
      - tinycss2==1.2.1
      - tomli==2.0.1
      - torch==1.13.0+cu117
      - tornado==6.3.3
      - tqdm==4.66.1
      - traitlets==5.10.0
      - typing-extensions==4.8.0
      - uri-template==1.3.0
      - urllib3==1.26.16
      - wcwidth==0.2.6
      - webcolors==1.13
      - webencodings==0.5.1
      - websocket-client==1.6.3
      - werkzeug==2.3.7

IT worked!! WHEN I change torch-2.0.0 into torch-1.13.0 , many thx.