Skip to content

Bug: Logger class missing warning() method causes AttributeError #113

@eminmeydanoglu

Description

@eminmeydanoglu

Description

The custom Logger class in logger.py is missing the warning() method, which causes an AttributeError when api.py attempts to call it.

Error Message

AttributeError: 'Logger' object has no attribute 'warning'

Stack Trace

File "src/depth_anything_3/api.py", line 334, in _align_to_input_extrinsics_intrinsics
    logger.warning(
    ^^^^^^^^^^^^^^
AttributeError: 'Logger' object has no attribute 'warning'

Root Cause

In api.py line 334, the code calls logger.warning():

logger.warning(
    "Pose alignment failed due to insufficient camera motion. "
    "Using model-estimated poses and relative depth."
)

However, the Logger class in logger.py only defines warn(), not warning():

def warn(self, *args, **kwargs):
    self.log("WARN:", *args, **kwargs)

Suggested Fix

Add a warning() method as an alias to warn() in the Logger class to match Python's standard logging module interface:

def warning(self, *args, **kwargs):
    """Alias for warn() to match standard logging interface."""
    self.warn(*args, **kwargs)

Environment

  • Using the inference API with external extrinsics/intrinsics alignment
  • Error occurs when pose alignment fails due to insufficient camera motion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions