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

[BUG] Numpy types are deprecated #88

Closed tms-gvd closed 1 year ago

tms-gvd commented 1 year ago

Describe the bug Deprecated numpy types after moving to v1.0.1

Steps to Reproduce

Blender quit

Fixed by replacing `np.bool` by `bool` at https://github.com/princeton-vl/infinigen/blob/aa22d4d1d4cb30de12f6aac453e6f49b87b787db/worldgen/terrain/utils/kernelizer_util.py#L78
Yet, another AttributeError is then raised:

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 27, in from terrain import Terrain File "/opt/infinigen/worldgen/terrain/init.py", line 7, in from .core import Terrain File "/opt/infinigen/worldgen/terrain/core.py", line 16, in from terrain.scene import scene, transfer_scene_info File "/opt/infinigen/worldgen/terrain/scene.py", line 10, in from terrain.elements.landtiles import LandTiles, Volcanos, FloatingIce File "/opt/infinigen/worldgen/terrain/elements/landtiles.py", line 12, in from terrain.assets.landtiles import assets_to_data, landtile_asset File "/opt/infinigen/worldgen/terrain/assets/landtiles/init.py", line 7, in from .core import assets_to_data, landtile_asset File "/opt/infinigen/worldgen/terrain/assets/landtiles/core.py", line 15, in from .ant_landscape import ant_landscape_asset File "/opt/infinigen/worldgen/terrain/assets/landtiles/ant_landscape.py", line 13, in from terrain.land_process.snowfall import run_snowfall File "/opt/infinigen/worldgen/terrain/land_process/snowfall.py", line 11, in from landlab.components import FlowDirectorSteepest, TransportLengthHillslopeDiffuser File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/components/init.py", line 1, in from .bedrock_landslider import BedrockLandslider File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/components/bedrock_landslider/init.py", line 1, in from .bedrock_landslider import BedrockLandslider File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/landlab/components/bedrock_landslider/bedrock_landslider.py", line 13, in from .cfuncs import _landslide_runout File "landlab/components/bedrock_landslider/cfuncs.pyx", line 5, in init landlab.components.bedrock_landslider.cfuncs File "/opt/infinigen/blender/3.3/python/lib/python3.10/site-packages/numpy/init.py", line 305, in getattr raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional in formation. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Blender quit



** (If this is your first time running Infinigen) What are the full output logs of `install.sh` ?**
Running with Docker container, the errors are raised independently of the config (CUDA, OpenGL)

**Platform**
- OS & OS Version: Ubuntu 22.04.2 LTS 
- GPU (?) : NVIDIA TITAN RTX
- GPU Driver Version (?) : 530.30.02
- RAM (GB): 64

**Additional context**
It might come from the changes in `requirements.txt` of commit aa22d4d1d4cb30de12f6aac453e6f49b87b787db 
araistrick commented 1 year ago

Hello, it seems you are correct, this change slipped through but did not work on all platforms. Thankyou for catching it, please pull main and I hope this resolves your issue.

tms-gvd commented 1 year ago

Thanks for the fix. FYI, I have now a new line in the logs, at each step of the helloworld tutorial (running inside a docker container with opengl and no gpu). Yet, I get the expected outputs when generating GT with OpenGL

Blender 3.3.1 (hash b292cfe5a936 built 2022-10-05 00:14:35)
COULD NOT LOAD RichDEM ENGINE! NOTHING WILL WORK!
...