至于infinigen是什么,网上很多,这篇文章主要是我安装的记录
官网:https://infinigen.org/
github:https://github.com/princeton-vl/infinigen
首先要配置wsl环境,如何配置wsl,可以关注公众号“科技探幽”,回复"wsl"获取教程,然后在Ubuntu中运行下面的命令
git clone --recursive https://github.com/princeton-vl/infinigen.git
cd infinigen
conda create --name infinigen python=3.10
conda activate infinigen
bash install.sh
修改环境变量,增加BLENDER
# on Linux/WSL
export BLENDER="/PATH/TO/infinigen/blender/blender"
# on MAC
export BLENDER="/PATH/TO/infinigen/Blender.app/Contents/MacOS/Blender"
要注意BLENDER命令时,前面的符号也要加上$BLENDER
cd worldgen
mkdir outputs
# Generate a scene layout
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task coarse -g desert simple --output_folder outputs/helloworld/coarse
# Populate unique assets
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task populate fine_terrain -g desert simple --input_folder outputs/helloworld/coarse --output_folder outputs/helloworld/fine
# Render RGB images
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task render -g desert simple --input_folder outputs/helloworld/fine --output_folder outputs/helloworld/frames
# Render again for accurate ground-truth
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task render -g desert simple --input_folder outputs/helloworld/fine --output_folder outputs/helloworld/frames -p render.render_image_func=@flat/render_image
scp -P 8888 [email protected]:/home/xx d:\xxx\xx
运行下面这条命令时,我的电脑报错了,如下
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task coarse -g desert simple --output_folder outputs/helloworld/coarse
错误如下
Blender 3.3.1 (hash b292cfe5a936 built 2022-10-05 00:14:35)
Read prefs: /home/bai/.config/blender/3.3/config/userpref.blend
/run/user/1000/gvfs/ non-existent directory
[11:25:00.894] [root] [INFO] | Converted args.seed='0' to scene_seed=0, parsed as hexadecimal
[11:25:00.912] [root] [INFO] | infinigen version 1.0.1
[11:25:00.912] [root] [INFO] | CUDA_VISIBLE_DEVICES=None
[11:25:00.913] [times] [INFO] | [MAIN TOTAL]
[11:25:00.913] [root] [INFO] | Processing frames 1 through 1 inclusive
[11:25:00.951] [times] [INFO] | [Create terrain]
[11:25:00.951] [root] [INFO] | Terrain using only on the fly on_the_fly_asset_folder=PosixPath('/home/bai/AI/infinigen/worldgen/outputs/helloworld/coarse/assets')
[11:26:52.103] [times] [INFO] | [Create terrain] failed with
[11:26:52.103] [times] [INFO] | [MAIN TOTAL] failed with
Error: Python: Traceback (most recent call last):
File "/home/bai/AI/infinigen/worldgen/generate.py", line 410, in
main()
File "/home/bai/AI/infinigen/worldgen/generate.py", line 400, in main
infinigen.main(
File "/home/bai/AI/infinigen/worldgen/core.py", line 425, in main
execute_tasks(
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/core.py", line 275, in execute_tasks
terrain = Terrain(scene_seed, surface.registry, task=task, on_the_fly_asset_folder=output_folder/"assets")
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/terrain/core.py", line 82, in __init__
self.elements, scene_infos = scene(seed, Path(on_the_fly_asset_folder), asset_path, device)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/terrain/scene.py", line 56, in scene
elements[ElementNames.LandTiles] = LandTiles(device, caves, on_the_fly_asset_folder, reused_asset_folder)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/terrain/elements/landtiles.py", line 95, in __init__
n_instances, tile_size, N, float_data = self.load_assets()
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/terrain/elements/landtiles.py", line 127, in load_assets
landtile_asset(self.on_the_fly_asset_folder / tile / f"{i}", tile, device=self.device)
File "/home/bai/AI/infinigen/worldgen/terrain/assets/landtiles/core.py", line 142, in landtile_asset
ant_landscape_asset(folder, preset_name, tile_size, resolution)
File "/home/bai/AI/infinigen/worldgen/terrain/assets/landtiles/ant_landscape.py", line 69, in ant_landscape_asset
if erosion: run_erosion(folder)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper utils.augment_exception_message_and_reraise(e, err_str)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper return fn(*new_args, **new_kwargs)
File "/home/bai/AI/infinigen/worldgen/terrain/land_process/erosion.py", line 28, in run_erosion
dll = load_cdll(f"terrain/lib/cpu/soil_machine/SoilMachine.so")
File "/home/bai/AI/infinigen/worldgen/terrain/utils/ctype_util.py", line 28, in load_cdll
return CDLL(Path(sys.path[-1]) / path, mode=RTLD_LOCAL)
File "/home/bai/AI/infinigen/blender/3.3/python/lib/python3.10/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /home/bai/AI/infinigen/worldgen/terrain/lib/cpu/soil_machine/SoilMachine.so: cannot open shared object file: No such file or directory
In call to configurable 'run_erosion' ()
In call to configurable 'load_assets' ()
In call to configurable 'LandTiles' ()
In call to configurable 'scene' ()
In call to configurable 'Terrain' ()
In call to configurable 'execute_tasks' ()
Blender quit
主要是由于缺少了文件
运行下面的命令构建SoilMachine.so文件
sudo apt install libglm-dev
cd worldgen/terrain
chmod +x install_terrain.sh
./install_terrain.sh