Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'engine.third_party' #2

Open
zhurui1995 opened this issue Nov 18, 2024 · 11 comments
Open

ModuleNotFoundError: No module named 'engine.third_party' #2

zhurui1995 opened this issue Nov 18, 2024 · 11 comments

Comments

@zhurui1995
Copy link

Hi,

I encountered an issue while trying to use the project. I received a ModuleNotFoundError when attempting to import the ‘engine.third_party’ module.

Environment:
OS: Windows 11
Python version: 3.11

I use this command "python scripts/run.py --tasks ./resources/examples/* --cond image --temperature 0.8".

when I run impl.py which generated by LLM, and I meet this Error.
image

I can't find third_party module in this project.
image

Thank you for your time and assistance!

@zzyunzhi
Copy link
Owner

Hi, could you attach the full error log? I believe your screenshot contains a warning (from

import traceback; traceback.print_exc()
) but is not an actual error. Thanks!

@zhurui1995
Copy link
Author

yes. there is the full error log.

==================----------------------------=====================
C:\Users\zhu.conda\envs\sclg\python.exe D:\to_do_3_4_d\scene-language-main\scripts\outputs\run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb\resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837\3\impl.py
ENGINE_MODE='exposed'
DRY_RUN=False
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/rover/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/table/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/table/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/rover/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/indoors/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/table/scene.xml not found
WARNING: D:/to_do_3_4_d/scene-language-main/scripts/assets/mitsuba/table/scene.xml not found
[ERROR] failed to load cv2
[WARNING] Failed to import neural pipelines.
Traceback (most recent call last):
File "D:\to_do_3_4_d\scene-language-main\scripts\prompts\impl_utils.py", line 10, in
from engine.utils.omost_utils import MyCanvas
File "D:\to_do_3_4_d\scene-language-main\engine\utils\omost_utils.py", line 16, in
class MyCanvas(Canvas):
^^^^^^
NameError: name 'Canvas' is not defined
[INFO] ('D:/to_do_3_4_d/scene-language-main/scripts/outputs/run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb/resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837/3/renderings',){}
[INFO] (None,){'verbose': False}
[INFO] ('D:/to_do_3_4_d/scene-language-main/scripts/outputs/run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb/resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837/3/renderings',){'verbose': False}
[INFO] (None, [[None], [None]]){'col_type': 'text'}
[WARNING] no roots specified, using the last function in the library
[INFO] calling node (supposed to be root): soda_pack
[INFO] registering children for can with 6 hist calls
[INFO] registering children for can_pack with 1 hist calls
[INFO] registering children for soda_pack with 1 hist calls
root='soda_pack'
[INFO] (None, [['Parsed root from program.']]){}
[INFO] (None, [['root function name: soda_pack'], ["scc=([{'can'}, {'can_pack'}, {'soda_pack'}], [[], [0], [0, 1]])"]]){}
[INFO] (None, [['root function name: soda_pack'], ["scc=([{'can'}, {'can_pack'}, {'soda_pack'}], [[], [0], [0, 1]])"]]){}
[INFO] (None, [['', '']]){'col_names': ['dependency', 'program']}
[INFO] executing soda_pack...

Traceback (most recent call last):
File "D:\to_do_3_4_d\scene-language-main\scripts\outputs\run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb\resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837\3\impl.py", line 308, in
main()
File "D:\to_do_3_4_d\scene-language-main\scripts\outputs\run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb\resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837\3\impl.py", line 42, in main
core(engine_modes=args.engine_modes, overwrite=args.overwrite, save_dir=args.log_dir,
File "D:\to_do_3_4_d\scene-language-main\scripts\outputs\run_20241118-151919_00e23f4e-47a5-4df4-9928-7e119359c0eb\resourcesexamples_ea3488ae-8299-52da-a094-d8e29bb56837\3\impl.py", line 168, in core
new_library = make_new_library(library=library, library_equiv=library_equiv, tree_depth=float("inf"), engine_mode='interior', root=root)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\to_do_3_4_d\scene-language-main\scripts\prompts\impl_helper.py", line 24, in make_new_library
decode_docstring = next(iter(library.values()))['docstring'].startswith('{')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

进程已结束,退出代码为 0

==================----------------------------=====================

Below is the complete code generated by gpt. I made some modifications so that it can run on Windows.

==================----------------------------=====================

import sys

sys.path.insert(0, r"D:\to_do_3_4_d\scene-language-main\scripts\prompts")

from pathlib import Path
import numpy as np

from scripts.prompts.helper import *
import mitsuba as mi
import traceback
import ipdb

import random
import math
import sys
import os

from scripts.prompts.dsl_utils import register_animation

# from dsl_utils import register_animation
import scripts.prompts.mi_helper as mi_helper  # such that primitive call will be implemented
import argparse
from typing import Literal, Optional

EXTRA_ENGINE_MODE = ['box', 'interior', 'exterior',
                     'gala3d', 'lmd', 'migc', 'loosecontrol', 'omost', 'densediffusion',
                     'neural']  # `densediffusion` must be the last as it modifies diffusers library


def get_parser():
    parser = argparse.ArgumentParser()
    parser.add_argument('--engine-modes', nargs='*', default=[], choices=EXTRA_ENGINE_MODE)
    parser.add_argument('--overwrite', action='store_true', default=False, help='overwrite existing renderings')
    parser.add_argument('--log-dir', type=str, default=(Path(__file__).parent / 'renderings').as_posix(), help='log directory')
    parser.add_argument('--dependency-path', type=str, default=None, help='dependency path')
    parser.add_argument('--program-path', type=str, default=None, help='program path')
    return parser


def main():
    args = get_parser().parse_args()
    core(engine_modes=args.engine_modes, overwrite=args.overwrite, save_dir=args.log_dir,
         dependency_path=args.dependency_path, program_path=args.program_path)


def core(engine_modes: list[Literal['neural', 'lmd', 'omost', 'loosecontrol', 'densediffusion']], overwrite: bool, save_dir: str,
         dependency_path: Optional[str] = None, program_path: Optional[str] = None, root: Optional[str] = None,
         tree_depths: Optional[list[int]] = None):
    try:
        import torch
        cuda_is_available = torch.cuda.is_available()
    except:
        cuda_is_available = False

    from PIL import Image
    from scripts.prompts.dsl_utils import library, animation_func, set_seed
    from scripts.prompts.impl_utils import create_nodes, run, redirect_logs
    from engine.utils.graph_utils import strongly_connected_components, get_root, calculate_node_depths
    from scripts.prompts.impl_helper import make_new_library
    from scripts.prompts.prompt_helper import load_program
    from scripts.prompts.impl_parse_dependency import parse_dependency
    from engine.constants import ENGINE_MODE
    try:
        from tu.loggers.utils import print_vcv_url
        from tu.loggers.utils import setup_vi
    except:
        print_vcv_url = lambda *args, **kwargs: print('[INFO]', str(args) + str(kwargs))

        class Helper:

            def dump_table(self, *args, **kwargs):
                print('[INFO]', str(args) + str(kwargs))

            def print_url(self, *args, **kwargs):
                print('[INFO]', str(args) + str(kwargs))

        setup_vi = lambda x: (None, Helper())

    # from mi_helper import execute_from_preset
    import imageio
    save_dir = Path(save_dir)
    save_dir.mkdir(exist_ok=True)
    print_vcv_url(save_dir.as_posix())

    vi, vi_helper = setup_vi(save_dir)
    vi_debug, _ = setup_vi(save_dir / 'debug')
    vi_helper.dump_table(vi, [
        [vi_helper.print_url(vi_debug, verbose=False)],
        [print_vcv_url(save_dir.as_posix(), verbose=False)],
    ], col_type='text')

    if cuda_is_available and animation_func is not None:
        print(f'[INFO] skipping animation on cluster')
    elif animation_func is not None:
        print(f'[INFO] rendering animation...')
        frames = list(animation_func())
        name = animation_func.__name__
        final_frame_paths = []
        if len(frames) > 8:
            frame_skip = int(len(frames) / 8)
            frames = frames[::frame_skip]
        out = mi_helper.execute_from_preset(sum(frames, []), save_dir=None)
        for i in range(len(frames)):
            frame_save_dir = save_dir / name / f'{i:02d}'
            _ = mi_helper.execute_from_preset(frames[i], save_dir=frame_save_dir.as_posix(), prev_out=out)
            # TODO change `sensor_info`
            traj_paths = list(sorted(frame_save_dir.glob('rendering_traj_[0-9][0-9][0-9].png')))
            final_frame_paths.append(traj_paths[0])
            if i == 0:
                imageio.mimsave((save_dir / f'{name}_static.gif').as_posix(), [np.asarray(Image.open(p)) for p in traj_paths], fps=4, loop=0)
                out['sensors'] = {'rendering_traj_000': out['sensors']['rendering_traj_000']}
        imageio.mimsave((save_dir / f'{name}_animation.gif').as_posix(), [np.asarray(Image.open(p)) for p in final_frame_paths], fps=len(final_frame_paths) / 2,
                        loop=0)

        return

    if root is not None:
        pass
    elif dependency_path is not None:
        root_node_ref, library_equiv_alt = parse_dependency(load_program(dependency_path))
        root = root_node_ref.name
    else:
        root = None
    library_equiv = create_nodes(roots=[root] if root is not None else None)
    success = True
    if success:
        if root is None:
            try:
                root = get_root(library_equiv)
                print(f'{root=}')
                vi_helper.dump_table(vi_debug, [['Parsed root from program.']])
            except Exception as e:
                # sometimes a function is implemented but never used, so there is no shared ancestor
                print('[ERROR] cannot find root', e)
                success = False
    if not success:
        if dependency_path is not None:
            from scripts.prompts.sketch_helper import transfer_dependency_to_library
            try:
                library_equiv = transfer_dependency_to_library(library_equiv_alt)
                root = get_root(library_equiv)
                print(f'{root=}')
                success = True
                vi_helper.dump_table(vi_debug, [['Parsed root from dependency.']])
            except Exception as e:
                print('[ERROR] cannot transfer dependency', e)
    if not success:
        root = None
        for name, node in library_equiv.items():  # do we need this? or just pick the last node?
            if len(node.parents) == 0 and len(node.children) > 0:
                root = name
        if root is not None:
            vi_helper.dump_table(vi_debug, [['Picked root with 0 parent and >=1 child from library.']])
        if root is None:
            root = next(reversed(library.keys()))
            vi_helper.dump_table(vi_debug, [['Last resort; picked last node from library.']])

    scc = strongly_connected_components(library_equiv)
    vi_helper.dump_table(vi, [[f'root function name: {root}'], [f'{scc=}']])
    vi_helper.dump_table(vi_debug, [[f'root function name: {root}'], [f'{scc=}']])
    vi_helper.dump_table(vi_debug, [[
        '' if dependency_path is None else load_program(dependency_path),
        '' if program_path is None else load_program(program_path)
    ]], col_names=['dependency', 'program'])

    print(f'[INFO] executing `{root}`...')
    # out = run(root, save_dir=save_dir.as_posix(), preset_id='table')
    new_library = make_new_library(library=library, library_equiv=library_equiv, tree_depth=float("inf"), engine_mode='interior', root=root)
    with set_seed(0):
        # frame = library_call(root)
        frame = new_library[root]['__target__']()
    out = mi_helper.execute_from_preset(frame, save_dir=None, preset_id='rover_background')  # compute normalization and sensors
    out = run(root, save_dir=save_dir.as_posix(), preset_id='rover_background', overwrite=overwrite, prev_out=out, new_library=new_library)
    print(f'[INFO] executing `{root}` done!')

    for name in library.keys():
        continue  # FIXME
        node_save_dir = Path(__file__).parent / 'nodes' / name
        node_save_dir.mkdir(parents=True, exist_ok=True)
        with redirect_logs((node_save_dir / f'log.txt').as_posix()):
            print(f'[INFO] executing `{name}`...')
            try:
                with set_seed(0):
                    frame = library_call(name)
            except Exception:
                print(f'[ERROR] failed to execute `{name}`')
                print(traceback.format_exc())
                continue
            _ = execute_from_preset(frame, save_dir=node_save_dir.as_posix(), preset_id='indoors_no_window',  # preset_id='table',
                                    normalization=out['normalization'],
                                    sensors={k: v for k, v in out['sensors'].items() if 'traj' not in k})
            print(f'[INFO] executing `{name}` done!')

    # change the function implementation from `primitive_call` for mitsuba to for other engines
    try:
        node_depths = calculate_node_depths(library_equiv, root=root)
        print(f'{node_depths=}')
        max_tree_depth = max(node_depths.values())
    except Exception as e:
        print(e)
        import traceback;
        traceback.print_exc()
        max_tree_depth = -1
    if next(iter(library.values()))['docstring'].startswith('{'):
        tree_depths = [-1]
    elif tree_depths is None:
        tree_depths = list(range(max_tree_depth + 1))
    extra_frame_paths: dict[tuple[str, int], list[Path]] = {}

    def load_image(path: Path, resolution: int = 512):
        image = Image.open(path.as_posix())
        # image = image.resize((resolution, int(resolution * image.height / image.width)), resample=Image.BILINEAR)
        image = image.resize((resolution, resolution), resample=Image.BILINEAR).convert('RGB')
        return image

    for engine_mode in EXTRA_ENGINE_MODE:
        if engine_mode not in engine_modes:
            continue
        if engine_mode not in ['box', 'interior', 'exterior'] and not cuda_is_available:
            continue
        print(f'[INFO] running with {engine_mode}')
        for tree_depth in tree_depths:
            new_library = make_new_library(
                library=library,
                library_equiv=library_equiv,
                tree_depth=tree_depth,
                engine_mode=engine_mode,
                root=root,
            )

            print(f'[INFO] running with {tree_depth=} new library {new_library.keys()}')
            extra_out = run(root, save_dir=save_dir.as_posix(), preset_id='rover_background',
                            engine_mode=engine_mode, prev_out=out,
                            save_suffix=f'depth_{tree_depth:02d}',
                            new_library=new_library,
                            overwrite=overwrite)

            extra_frame_paths[(engine_mode, tree_depth)] = extra_out['final_frame_paths']

            for frame_ind, images_to_concat in enumerate(zip(*filter(None, extra_out['seq_name_to_frame_paths'].values()))):
                vi_helper.dump_table(vi_debug, [[f'engine_mode_{engine_mode}_tree_depth_{tree_depth}_viewpoint_{frame_ind:02d}']])
                vi_helper.dump_table(vi_debug, [list(map(load_image, images_to_concat))])

    # for tree_depth in np.linspace(0, max(max_tree_depth, 0), num=min(5, max(max_tree_depth, 0) + 1), dtype=int):
    # depth_candidates = list(range(max(max_tree_depth + 1, 1)))  # when max_tree_depth == -1, still execute the loop once
    depth_candidates = [0] if len(tree_depths) == 0 else tree_depths
    if len(depth_candidates) > 5:
        depth_candidates = depth_candidates[:4] + [depth_candidates[-1]]
    for tree_depth in depth_candidates:
        vi_helper.dump_table(vi, [[f'starting tree_depth={tree_depth:02d}']])
        runtime_engine_modes = [ENGINE_MODE]

        frame_paths_to_show = [out['final_frame_paths']]
        for engine_mode in EXTRA_ENGINE_MODE:
            if len(extra_frame_paths.get((engine_mode, tree_depth), [])) == 0:
                continue
            runtime_engine_modes.append(engine_mode)
            frame_paths_to_show.append(extra_frame_paths[(engine_mode, tree_depth)])
        for frame_ind, images_to_concat in enumerate(zip(*frame_paths_to_show)):
            vi_helper.dump_table(vi, [[f'tree_depth={tree_depth:02d}, viewpoint={frame_ind:02d}']])
            vi_helper.dump_table(vi, [list(map(load_image, images_to_concat))], col_names=[*runtime_engine_modes])

    # for p in sum(seq_name_to_frame_paths.values(), []):
    #     p.unlink()

    vi_helper.print_url(vi)
    vi_helper.print_url(vi_debug)


from scripts.prompts.helper import *


@register()
def can(radius: float, height: float) -> Shape:
    return primitive_call('cylinder', color=(1.0, 0.0, 0.0), shape_kwargs={'radius': radius, 'p0': (0, 0, 0), 'p1': (0, height, 0)})


@register()
def can_pack(radius: float, height: float, num_rows: int, num_cols: int) -> Shape:
    def loop_fn(row) -> Shape:
        def inner_loop_fn(col) -> Shape:
            x_offset = col * 2.5 * radius
            z_offset = row * 2.5 * radius
            can_shape = library_call('can', radius=radius, height=height)
            return transform_shape(can_shape, translation_matrix((x_offset, 0, z_offset)))

        return loop(num_cols, inner_loop_fn)

    return loop(num_rows, loop_fn)


@register()
def soda_pack() -> Shape:
    radius = 0.07
    height = 0.12
    num_rows = 2
    num_cols = 3
    return library_call('can_pack', radius=radius, height=height, num_rows=num_rows, num_cols=num_cols)


"""


"""

if __name__ == "__main__":
    try:
        main()
    except Exception as e:
        extype, value, tb = sys.exc_info()
        print(e)
        print(traceback.format_exc())
        # ipdb.post_mortem(tb)

==================----------------------------=====================

Looking forward to your answer.

@zhurui1995
Copy link
Author

I don't know why, but I still ran it successfully even though the code reported an error.

Thanks to the author for his nice work.

By the way, if you want to run it on Windows, you need to add the following statement at the beginning of the impl.py file and run the impl.py to generate the renderings folder and the corresponding .git file.

# impl.py 
import os
os.environ['ENGINE_MODE'] = "exposed"
os.environ['DEBUG'] = '0'

import sys
sys.path.insert(0, r"D:\to_do_3_4_d\scene-language-main\scripts\prompts")

--tasks "a spider puppet"
exposed_spider_puppet_rover_background_rendering_traj

Interesting spider ~

@WarrenZZZZL
Copy link

I also meet the same error, do you know why this happend? Thank you:
Traceback (most recent call last):
File "/home/lzha0538/3Dediting/scene-language/scripts/prompts/impl_utils.py", line 10, in
from engine.utils.omost_utils import MyCanvas
File "/home/lzha0538/3Dediting/scene-language/engine/utils/omost_utils.py", line 2, in
from engine.third_party.omost.lib_omost.canvas import Canvas, valid_colors, safe_str
ModuleNotFoundError: No module named 'engine.third_party'

Critical Dr.Jit compiler failure: cuda_check(): API error 0718 (CUDA_ERROR_INVALID_PC): "invalid program counter" in /project/ext/drjit-core/src/eval.cpp:395.
Aborted (core dumped)

@WarrenZZZZL
Copy link

When I use mitsuba3.6.0 and it gave me AttributeError: module 'mitsuba' has no attribute 'Sensor'
And when I use mitsuba3.5.1 and it gave me ModuleNotFoundError: No module named 'engine.third_party'

ubuntu system

@zzyunzhi
Copy link
Owner

zzyunzhi commented Dec 4, 2024

Hi @WarrenZZZZL, thanks for reporting the error. Could you please attach the full error log after switching to mitsuba3.5.1?

@WarrenZZZZL
Copy link

Hi @WarrenZZZZL, thanks for reporting the error. Could you please attach the full error log after switching to mitsuba3.5.1?

sclg) lzha0538@gpu1-3w-1:/3Dediting/scene-language$ pip show mitsuba
Name: mitsuba
Version: 3.5.1
Summary: 3: A Retargetable Forward and Inverse Renderer
Home-page: https://github.com/mitsuba-renderer/mitsuba3
Author: Realistic Graphics Lab (RGL), EPFL
Author-email: [email protected]
License: BSD
Location: /home/lzha0538/miniconda3/envs/sclg/lib/python3.11/site-packages
Requires: drjit
Required-by:
(sclg) lzha0538@gpu1-3w-1:
/3Dediting/scene-language$ pip show pytorch
WARNING: Package(s) not found: pytorch
(sclg) lzha0538@gpu1-3w-1:/3Dediting/scene-language$ pip show torc
WARNING: Package(s) not found: torc
(sclg) lzha0538@gpu1-3w-1:
/3Dediting/scene-language$ pip show torch
Name: torch
Version: 2.5.1+cu121
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/lzha0538/miniconda3/envs/sclg/lib/python3.11/site-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvtx-cu12, sympy, triton, typing-extensions
Required-by: torchaudio, torchvision
(sclg) lzha0538@gpu1-3w-1:/3Dediting/scene-language$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0
(sclg) lzha0538@gpu1-3w-1:
/3Dediting/scene-language$ python scripts/run.py --tasks "a chessboard with a full set of chess pieces"
ENGINE_MODE='exposed'
DRY_RUN=False
Unable to import Llama modules. Are you running on cluster?
/home/lzha0538/3Dediting/scene-language/scripts/outputs/stubgen/20241020-145124-exposed-calc/header.pyi
[INFO] ('/home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe',){}
[INFO] Claude: querying for num_completions=4, skip_cache_completions=0
[INFO] Claude: cache hit 4
[INFO] Executing command:
ENGINE_MODE=exposed DEBUG=0 PYTHONPATH=/home/lzha0538/3Dediting/scene-language/scripts/prompts:$PYTHONPATH python /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/0/impl.py
[INFO] Outputs will be saved to /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/0
[INFO] result.returncode=0
[INFO] Executing command:
ENGINE_MODE=exposed DEBUG=0 PYTHONPATH=/home/lzha0538/3Dediting/scene-language/scripts/prompts:$PYTHONPATH python /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/1/impl.py
[INFO] Outputs will be saved to /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/1
[INFO] result.returncode=134
[INFO] Executing command:
ENGINE_MODE=exposed DEBUG=0 PYTHONPATH=/home/lzha0538/3Dediting/scene-language/scripts/prompts:$PYTHONPATH python /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2/impl.py
[INFO] Outputs will be saved to /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2
[INFO] result.returncode=134
[INFO] Executing command:
ENGINE_MODE=exposed DEBUG=0 PYTHONPATH=/home/lzha0538/3Dediting/scene-language/scripts/prompts:$PYTHONPATH python /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/3/impl.py
[INFO] Outputs will be saved to /home/lzha0538/3Dediting/scene-language/scripts/outputs/run_20241205-133052_a2f9a667-ddb0-4669-ad90-d3d0d2059dfe/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/3
[INFO] result.returncode=134
(sclg) lzha0538@gpu1-3w-1:~/3Dediting/scene-language$

Traceback (most recent call last):
File "/home/lzha0538/3Dediting/scene-language/scripts/prompts/impl_utils.py", line 10, in
from engine.utils.omost_utils import MyCanvas
File "/home/lzha0538/3Dediting/scene-language/engine/utils/omost_utils.py", line 2, in
from engine.third_party.omost.lib_omost.canvas import Canvas, valid_colors, safe_str
ModuleNotFoundError: No module named 'engine.third_party'

Critical Dr.Jit compiler failure: cuda_check(): API error 0718 (CUDA_ERROR_INVALID_PC): "invalid program counter" in /project/ext/drjit-core/src/eval.cpp:395.
Aborted (core dumped)

@weiyuemin
Copy link

Hello, I'm facing the same problem, ( No module named 'engine.third_party' )
environment: Ubuntu, python 3.11.11, mitsuba3.5.1
(max_tokens modified to 8000)

execute_err.txt
execute_out.txt

@weiyuemin
Copy link

weiyuemin commented Jan 4, 2025

lack of omost seemed to be a warning, so the problem is the exception in execute_out.txt ?

chess_set() missing 1 required positional argument: 'square_size'
Traceback (most recent call last):
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/0/impl.py", line 439, in
main()
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/0/impl.py", line 37, in main
core(engine_modes=args.engine_modes, overwrite=args.overwrite, save_dir=args.log_dir,
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/0/impl.py", line 117, in core
library_equiv = create_nodes(roots=[root] if root is not None else None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/impl_utils.py", line 620, in create_nodes
_ = library_call(root)
^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 234, in library_call
return library[func_name]'target'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 101, in wrapper
ret = func(*args, **kwargs) # FIXME should use the function in the library
^^^^^^^^^^^^^^^^^^^^^
TypeError: chess_set() missing 1 required positional argument: 'square_size'

or

Traceback (most recent call last):
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2/impl.py", line 443, in
main()
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2/impl.py", line 37, in main
core(engine_modes=args.engine_modes, overwrite=args.overwrite, save_dir=args.log_dir,
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2/impl.py", line 117, in core
library_equiv = create_nodes(roots=[root] if root is not None else None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/impl_utils.py", line 620, in create_nodes
_ = library_call(root)
^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 234, in library_call
return library[func_name]'target'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 101, in wrapper
ret = func(*args, **kwargs) # FIXME should use the function in the library
^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/outputs/run_20250104-112930_b3b0efc7-8d58-4c6e-9c19-26c2ed5e5fa7/a_chessboard_with_a_full_set_of_chess_pieces_f44954b0-838f-5dd5-8379-2f0edff77400/2/impl.py", line 437, in chessboard_with_pieces
board = library_call('chessboard')
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 234, in library_call
return library[func_name]'target'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wei/scene-language/scripts/prompts/dsl_utils.py", line 111, in wrapper
elem['info']['stack'].append((func.name, call_id))
~~~~^^^^^^^^
TypeError: list indices must be integers or slices, not str

@zzyunzhi
Copy link
Owner

zzyunzhi commented Jan 5, 2025

File "/home/lzha0538/3Dediting/scene-language/engine/utils/omost_utils.py", line 2, in from engine.third_party.omost.lib_omost.canvas import Canvas, valid_colors, safe_str ModuleNotFoundError: No module named 'engine.third_party'

Critical Dr.Jit compiler failure: cuda_check(): API error 0718 (CUDA_ERROR_INVALID_PC): "invalid program counter" in /project/ext/drjit-core/src/eval.cpp:395. Aborted (core dumped)

Hi @WarrenZZZZL it seems that the error comes from mitsuba installation. Could you please test if the following runs successfully?

import mitsuba as mi
mi.set_variant('scalar_rgb')
print(mi.Sensor)

This is to test if mitsuba is correctly installed.

@zzyunzhi
Copy link
Owner

zzyunzhi commented Jan 5, 2025

Hi @weiyuemin,

The error here is that the root function takes in a keyword argument without providing the default values. In the current implementation, the root function chess_set will be called directly as chess_set() and therefore raises the TypeError you observed in execute_out.txt. The current pipeline unfortunately cannot automatically recover from such errors and here are quick, short-term fixes:

  1. You could manually fix the program by passing in default arguments, e.g., def chess_set(square_size=some_reasonable_constant) in the impl.py within your current output directory, and then run PYTHONPATH=${ROOT}/scripts/prompts python impl.py.
  2. Run with python scripts.py --num-completions some_higher_number and/or python scripts.py --temperature some_higher_temperature to get different samples from the language model. Note that previous results under the same prompt will be cached and reused. That is, if you have run --num-completions 4 and now run again with --num-completions 5, only 5 - 4 = 1 new sample will be generated.

Please let me know if the issue persists. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants