princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.32k stars 455 forks source link

run hello_world in Docker got 'numpy._DTypeMeta' object is not subscriptable #163

Closed weiminw closed 10 months ago

weiminw commented 11 months ago

Describe the bug

A clear and concise description of what the bug is.

Steps to Reproduce

What version of the code were you using?

''' What is the output of git log -n 1? '''

What command did you run?

$BLENDER -noaudio --background --python generate.py -- --seed 0 --task coarse -g desert.gin simple.gin --output_folder outputs/hello_world/coarse

What are your FULL output logs?

Blender 3.3.1 (hash b292cfe5a936 built 2022-10-05 00:14:35)
Error: Python: Traceback (most recent call last):
  File "/opt/infinigen/worldgen/generate.py", line 20, in <module>
    from terrain import Terrain
  File "/opt/infinigen/worldgen/terrain/__init__.py", line 7, in <module>
    from .core import Terrain
  File "/opt/infinigen/worldgen/terrain/core.py", line 16, in <module>
    from terrain.scene import scene, transfer_scene_info
  File "/opt/infinigen/worldgen/terrain/scene.py", line 10, in <module>
    from terrain.elements.landtiles import LandTiles, Volcanos, FloatingIce
  File "/opt/infinigen/worldgen/terrain/elements/landtiles.py", line 12, in <module>
    from terrain.assets.landtiles import assets_to_data, landtile_asset
  File "/opt/infinigen/worldgen/terrain/assets/landtiles/__init__.py", line 7, in <module>
    from .core import assets_to_data, landtile_asset
  File "/opt/infinigen/worldgen/terrain/assets/landtiles/core.py", line 15, in <module>
    from .ant_landscape import ant_landscape_asset
  File "/opt/infinigen/worldgen/terrain/assets/landtiles/ant_landscape.py", line 13, in <module>
    from terrain.land_process.snowfall import run_snowfall
  File "/opt/infinigen/worldgen/terrain/land_process/snowfall.py", line 10, in <module>
    from landlab import RasterModelGrid
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/__init__.py", line 17, in <module>
    from .core.model_component import Component
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/core/model_component.py", line 36, in <module>
    from ..field import FieldError
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/field/__init__.py", line 2, in <module>
    from .graph_field import GraphFields
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/field/graph_field.py", line 2, in <module>
    import xarray as xr
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/__init__.py", line 3, in <module>
    from xarray import testing, tutorial
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/testing.py", line 11, in <module>
    from xarray.core.coordinates import Coordinates
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/core/coordinates.py", line 16, in <module>
    from xarray.core.alignment import Aligner
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/core/alignment.py", line 24, in <module>
    from xarray.core.variable import Variable, as_compatible_data, calculate_dimensions
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/core/variable.py", line 48, in <module>
    from xarray.namedarray.core import NamedArray
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/namedarray/core.py", line 24, in <module>
    from xarray.namedarray._typing import (
  File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/xarray/namedarray/_typing.py", line 28, in <module>
    _DType = TypeVar("_DType", bound=np.dtype[Any])
TypeError: 'numpy._DTypeMeta' object is not subscriptable

If this is your first time running Infinigen, what are the full output logs of install.sh ?**

Platform

Additional context

Add any other context about the problem here.

MalcDuck commented 11 months ago

Having the EXACT same issue here. No Errors in install log. And I believe i followed ALL The steps to install correctly.

But as the above user didnt attach their install script, here's mine:

InfinigenDuck.txt

And as it always seems to be asked :

wsl -l -v NAME STATE VERSION

MalcDuck commented 11 months ago

Hi Weiminw

Just FYI - I fixed this in my code by adding :

xarray==2023.9.0

to requirements.txt, as the latest version breaks the code.

Then run

bash install.sh again, and all should be well (or it was for me)

araistrick commented 11 months ago

Thanks for the fix @MalcDuck, either I can patch this onto main or id happily accept a PR. We experienced this before in #156 where an update to scipy also broke compatibility with our numpy version. Our numpy is relatively old but im surprised this keeps popping up. I could just pin our entire requirements.txt to specific versions but I feel this is a little restrictive. On our rc_1.1.1 preview branch I have updated our code to work with the latest numpy version but that branch still has some visual bugs, I may try to separate out and backport this fix.

Khoa-NT commented 11 months ago

Hi Weiminw

Just FYI - I fixed this in my code by adding :

xarray==2023.9.0

to requirements.txt, as the latest version breaks the code.

Then run

bash install.sh again, and all should be well (or it was for me)

I can confirm that this works for my M2 MBA

weiminw commented 11 months ago

Hi Weiminw

Just FYI - I fixed this in my code by adding :

xarray==2023.9.0

to requirements.txt, as the latest version breaks the code.

Then run

bash install.sh again, and all should be well (or it was for me)

great thanks to you,i upgrade the numpy to 1.23.5,error is gone

araistrick commented 10 months ago

Hello all, thanks for reporting this issue, this should now be fixed by #176 on main.