Skip to content

Commit

Permalink
Move gin initialization inside slurm-submitted function, so slurm job…
Browse files Browse the repository at this point in the history
…s recieve gin configs
  • Loading branch information
araistrick authored and pvl-bot committed Oct 18, 2024
1 parent d5d349c commit f6c312d
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions infinigen_examples/generate_individual_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,25 @@ def build_and_save_asset(payload: dict):

output_folder.mkdir(exist_ok=True)

init.apply_gin_configs(
["infinigen_examples/configs_indoor", "infinigen_examples/configs_nature"],
configs=args.configs,
overrides=args.overrides,
skip_unknown=True,
)

if args.debug is not None:
for name in logging.root.manager.loggerDict:
if not name.startswith("infinigen"):
continue
if len(args.debug) == 0 or any(name.endswith(x) for x in args.debug):
logging.getLogger(name).setLevel(logging.DEBUG)

init.configure_blender()

if args.gpu:
init.configure_render_cycles()

logger.info(f"Building scene for {factory_name} {idx}")

if args.seed > 0:
Expand Down Expand Up @@ -454,25 +473,6 @@ def mapfunc(
def main(args):
bpy.context.window.workspace = bpy.data.workspaces["Geometry Nodes"]

init.apply_gin_configs(
["infinigen_examples/configs_indoor", "infinigen_examples/configs_nature"],
configs=args.configs,
overrides=args.overrides,
skip_unknown=True,
)

if args.debug is not None:
for name in logging.root.manager.loggerDict:
if not name.startswith("infinigen"):
continue
if len(args.debug) == 0 or any(name.endswith(x) for x in args.debug):
logging.getLogger(name).setLevel(logging.DEBUG)

init.configure_blender()

if args.gpu:
init.configure_render_cycles()

if args.output_folder is None:
outputs = Path("outputs")
assert outputs.exists(), outputs
Expand Down

0 comments on commit f6c312d

Please sign in to comment.