def wrapper_type_from_ob_spec(ob_spec):
    """Returns:
      wrapper_type: str,
        'image' or 'graph'
      ob_dim: int
    """
    ob_name = getattr(ob_spec, 'name', None)

    if ob_name == 'AgentCamera':
        wrapper_type = 'image'
        ob_dim = ob_spec.shape  # (64, 64, 3)
    elif ob_name is None and 'nodes' in ob_spec:
        wrapper_type = 'graph'
        ob_dim = ob_spec['nodes'].shape[1] # 18 for all tasks except marble run
    else:
        raise ValueError("Unrecognized observation spec")

    return wrapper_type, ob_dim