VIDA-NYU / tile2net

Automated mapping of pedestrian networks from aerial imagery tiles
BSD 3-Clause "New" or "Revised" License
148 stars 23 forks source link

Error running example.sh on colab #3

Closed wenshutang closed 1 year ago

wenshutang commented 1 year ago

First of thank you for releasing the weights and for the project itself!

I managed to set up the right dependencies on colab, python 3.10 was specially problematic. I'm hitting the following errors when running the example:

Please enter the output directory:
./output
Tile generation will now begin.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/__init__.py", line 13, in <module>
    from tile2net.raster.raster import Raster
  File "/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/raster/raster.py", line 33, in <module>
    from tile2net.raster.tile_utils.geodata_utils import prepare_gdf, prepare_spaindex, read_dataframe
ImportError: cannot import name 'prepare_spaindex' from 'tile2net.raster.tile_utils.geodata_utils' (/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/raster/tile_utils/geodata_utils.py)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/__init__.py", line 13, in <module>
    from tile2net.raster.raster import Raster
  File "/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/raster/raster.py", line 33, in <module>
    from tile2net.raster.tile_utils.geodata_utils import prepare_gdf, prepare_spaindex, read_dataframe
ImportError: cannot import name 'prepare_spaindex' from 'tile2net.raster.tile_utils.geodata_utils' (/content/drive/MyDrive/Sandbox/tile2net/src/tile2net/raster/tile_utils/geodata_utils.py)
Mary-h86 commented 1 year ago

Thanks for pointing that out. I fixed that couple of hours ago, do a git pull and it should be resolved. During the Beta release, I also recommend to always do a git pull before running, to make sure you have the most updated version.

Regarding Colab, I haven’t tried installing it there myself, but our tests with the environment set up and installation on several different Windows and Linux machines went pretty smoothly. I will add Colab to the list of our tests. Are you using Python 3.10.9?

Mary-h86 commented 1 year ago

I will close this issue since I think the problem has been resolved. Please feel free to reopen this issue if there are any further concerns or questions. Thank you for your contribution!