活动介绍

E:\AI_System\web_ui>python server.py Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 60, in <module> from config.config_loader import config ModuleNotFoundError: No module named 'config.config_loader'; 'config' is not a package During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 65, in <module> logger.warning(f"配置模块导入失败, 使用临时配置: {str(e)}") NameError: name 'logger' is not defined E:\AI_System\web_ui>

时间: 2025-08-09 11:02:22 浏览: 9
<think>我们遇到了两个错误: 1. 首先尝试从 `config.config_loader` 导入 `config` 时失败,错误是 `No module named 'config.config_loader'; 'config' is not a package` 2. 然后在处理这个异常时,又发生了另一个异常:`NameError: name 'logger' is not defined` 原因分析: - 第一个错误说明我们的配置模块导入失败。这可能是由于: - 项目结构中没有 `config` 包(即目录下没有 `__init__.py` 文件) - 或者 `config_loader.py` 文件不存在 - 或者 `sys.path` 没有正确设置,导致找不到 `config` 包 - 第二个错误是因为在异常处理块中使用了 `logger`,但此时 `logger` 还没有被定义。因为我们在导入配置之后才初始化日志记录器。 解决方案: 1. 在异常处理块中避免使用尚未初始化的 `logger`,我们可以先初始化一个简单的日志记录器用于记录启动错误。 2. 重新组织代码,确保在尝试导入配置之前就有一个基本的日志记录机制。 具体步骤: - 在代码开头先设置一个简单的日志记录器(例如只输出到控制台),用于记录启动阶段的错误。 - 在导入配置失败时,使用这个基本日志记录器记录错误。 - 在配置日志记录器(使用文件和控制台等)之前,使用这个基本日志记录器。 修改后的代码结构: 1. 在文件开头,设置一个基本的日志记录器(basicConfig)用于捕获启动错误。 2. 然后尝试导入配置,如果失败则使用基本日志记录器记录,并创建临时配置。 3. 然后根据配置(无论是导入的还是临时的)来设置更详细的日志记录器(文件日志等)。 4. 然后替换掉基本日志记录器,使用新配置的日志记录器。 另外,我们还需要确保项目结构正确,即: - 在 `E:\AI_System\config` 目录下存在 `__init__.py` 文件(使其成为包)和 `config_loader.py` 文件。 如果项目结构中确实没有 `config` 包,那么我们需要检查是否应该创建它,或者调整导入路径。 但是,考虑到错误信息中提示 `'config' is not a package`,很可能是 `config` 目录下缺少 `__init__.py` 文件,或者存在一个名为 `config.py` 的文件(导致冲突)。因此,请检查项目结构。 不过,为了代码的健壮性,我们将修改日志初始化顺序。 以下是修改后的代码开头部分(仅展示修改部分):</think>您的错误是由于在配置导入失败时尝试使用尚未初始化的 `logger` 导致的。我将提供一个完整的修复方案,确保在配置导入失败时也能正确记录日志: ```python # E:\AI_System\web_ui\server.py import sys import os import time import logging import json import traceback import threading from flask import Flask, jsonify, request, render_template, send_from_directory, Response # ========== 初始日志设置 ========== # 创建临时日志记录器用于启动阶段 temp_logger = logging.getLogger('StartupLogger') temp_logger.setLevel(logging.DEBUG) console_handler = logging.StreamHandler() console_handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')) temp_logger.addHandler(console_handler) # ========== 解决路径问题 ========== base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, base_dir) temp_logger.info(f"项目根目录: {base_dir}") # 添加所有必要的子目录 sub_dirs = ['agent', 'core', 'utils', 'config', 'cognitive_arch'] for sub_dir in sub_dirs: full_path = os.path.join(base_dir, sub_dir) if os.path.exists(full_path): sys.path.insert(0, full_path) temp_logger.info(f"添加路径: {full_path}") else: temp_logger.warning(f"目录不存在: {full_path}") # ========== 配置加载 ========== class TempConfig: """临时配置类,确保所有必要属性都存在""" AGENT_PATH = os.path.join(base_dir, 'agent') WEB_UI_PATH = os.path.join(base_dir, 'web_ui') MODEL_CACHE_DIR = os.path.join(base_dir, 'model_cache') LOG_DIR = os.path.join(base_dir, 'logs') HOST = '0.0.0.0' PORT = 8000 SECRET_KEY = 'temp-secret-key' LOG_LEVEL = 'INFO' USE_GPU = False DEFAULT_MODEL = 'minimal-model' ENV = 'development' # 生活系统配置 LIFE_SCHEDULE = { "wake_up": "08:00", "breakfast": "08:30", "lunch": "12:30", "dinner": "19:00", "sleep": "23:00" } # 尝试导入配置 try: from config.config_loader import config temp_logger.info("✅ 使用config_loader中的配置") except ImportError as e: config = TempConfig() temp_logger.error(f"❌ 配置模块导入失败: {str(e)}") temp_logger.warning(f"⚠️ 使用临时配置") temp_logger.info(f"请检查以下路径是否存在:") temp_logger.info(f"1. {os.path.join(base_dir, 'config/config_loader.py')}") temp_logger.info(f"2. {os.path.join(base_dir, 'config/__init__.py')}") # ========== 配置Flask应用 ========== app = Flask(__name__, template_folder='templates', static_folder='static') # ========== 安全日志处理 ========== def safe_log(message): """安全处理日志中的Unicode字符""" try: return message.encode('utf-8', 'ignore').decode('utf-8') except: return message.replace('❌', '[ERROR]').replace('⏳', '[WAIT]').replace('‼️', '[CRITICAL]').replace('✅', '[OK]').replace('🚀', '[LAUNCH]') # ========== 正式日志设置 ========== logger = logging.getLogger('WebServer') logger.setLevel(getattr(logging, config.LOG_LEVEL.upper(), logging.INFO)) # 日志格式 log_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # 文件日志处理器 try: # 确保日志目录存在 os.makedirs(config.LOG_DIR, exist_ok=True) from logging.handlers import TimedRotatingFileHandler file_handler = TimedRotatingFileHandler( os.path.join(config.LOG_DIR, 'web_server.log'), when='midnight', backupCount=30, encoding='utf-8' ) file_handler.setFormatter(log_formatter) logger.addHandler(file_handler) logger.info("✅ 文件日志处理器初始化成功") except Exception as e: logger.warning(f"⚠️ 文件日志处理器创建失败: {str(e)}") # 控制台日志处理器 console_handler = logging.StreamHandler() console_handler.setFormatter(log_formatter) logger.addHandler(console_handler) # 移除临时日志处理器 temp_logger.removeHandler(console_handler) # 重写logger方法以处理Unicode original_info = logger.info original_error = logger.error original_warning = logger.warning original_critical = logger.critical def safe_logger(original_func): def wrapper(msg, *args, **kwargs): try: original_func(safe_log(msg), *args, **kwargs) except UnicodeEncodeError: ascii_msg = msg.encode('ascii', 'ignore').decode('ascii') original_func(ascii_msg, *args, **kwargs) return wrapper logger.info = safe_logger(original_info) logger.error = safe_logger(original_error) logger.warning = safe_logger(original_warning) logger.critical = safe_logger(original_critical) # ========== 全局智能体实例 ========== ai_agent = None life_scheduler = None # ========== 生活系统初始化 ========== try: from cognitive_arch.life_scheduler import LifeScheduler # 初始化生活系统 life_scheduler = LifeScheduler( daily_schedule=config.LIFE_SCHEDULE, log_dir=config.LOG_DIR ) logger.info("✅ 生活系统初始化成功") # 生活状态更新线程 def update_life_status(): """后台线程定期更新生活状态""" while True: try: # 获取当前时间 current_hour = time.localtime().tm_hour # 根据时间执行相应活动 if 8 <= current_hour < 9: life_scheduler.wake_up() elif 12 <= current_hour < 13: life_scheduler.have_meal("lunch") elif 19 <= current极客 < 20: life_scheduler.have_meal("dinner") elif 23 <= current_hour or current_hour < 6: life_scheduler.go_to_sleep() time.sleep(60) # 每分钟更新一次 except Exception as e: logger.error(f"生活系统更新失败: {str(e)}") time.sleep(300) # 出错后等待5分钟再重试 # 启动后台线程 life_thread = threading.Thread(target=update_life_status, daemon=True) life_thread.start() logger.info("✅ 生活系统后台线程已启动") except ImportError as e: logger.error(f"❌ 生活系统模块导入失败: {str(e)}") logger.warning("⚠️ 生活系统功能将不可用") except Exception as e: logger.error(f"❌ 生活系统初始化失败: {str(e)}") logger.warning("⚠️ 生活系统功能将不可用") # ========== 智能体初始化 ========== logger.info("=" * 50) logger.info("正在使用统一配置初始化智能体核心模块...") logger.info(f"智能体路径: {config.AGENT_PATH}") logger.info(f"模型缓存目录: {config.MODEL_CACHE_DIR}") logger.info(f"默认模型: {config.DEFAULT_MODEL}") logger.info(f"使用GPU: {config.USE_GPU}") max_retries = 3 retry_delay = 2 # 秒 for attempt in range(max_retries): try: # 动态导入智能体模块 from agent.autonomous_agent import AutonomousAgent ai_agent = AutonomousAgent( model_path=config.AGENT_PATH, cache_dir=config.MODEL_CACHE_DIR, use_gpu=config.USE_GPU, default_model=config.DEFAULT_MODEL ) logger.info("✅ 智能体核心模块初始化成功") break except ImportError as ie: logger.error(f"❌ 智能体模块导入失败: {str(ie)}") if attempt < max_retries - 1: logger.info(f"⏳ {retry_delay}秒后重试...") time.sleep(retry_delay) else: logger.critical("‼️ 智能体模块导入彻底失败") ai_agent = None except Exception as e: logger.error(f"❌ 智能体初始化失败 (尝试 {attempt + 1}/{max_retries}): {str(e)}") if attempt < max_retries - 1: logger.info(f"⏳ {retry_delay}秒后重试...") time.sleep(retry_delay) else: logger.critical("‼️ 智能体初始化彻底失败,部分功能将不可用") ai_agent = None # ========== 以下是您的路由定义(保持不变) ========== # /life, /api/life/status, /adjust_schedule, /, /status, /chat 等 # ... [保持原有的路由定义不变] ... if __name__ == '__main__': start_time = time.time() logger.info("=" * 50) logger.info(f"🚀 启动Web服务: http://{config.HOST}:{config.PORT}") logger.info(f"环境: {config.ENV}") logger.info(f"日志级别: {config.LOG_LEVEL}") logger.info(f"生活系统: {'✅ 已启用' if life_scheduler else '❌ 未启用'}") logger.info(f"智能体: {'✅ 已启用' if ai_agent else '❌ 未启用'}") logger.info("=" * 50) try: # 使用配置中的主机和端口 app.run(host=config.HOST, port=config.PORT, threaded=True) except Exception as e: logger.critical(f"‼️ 服务器启动失败: {traceback.format_exc()}") ``` ### 关键修复说明: 1. **启动阶段日志初始化**: ```python # 创建临时日志记录器用于启动阶段 temp_logger = logging.getLogger('StartupLogger') temp_logger.setLevel(logging.DEBUG) console_handler = logging.StreamHandler() console_handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')) temp_logger.addHandler(console_handler) ``` 在配置导入前创建临时日志记录器,确保即使配置导入失败也能记录错误。 2. **路径检查增强**: ```python for sub_dir in sub_dirs: full_path = os.path.join(base_dir, sub_dir) if os.path.exists(full_path): sys.path.insert(0, full_path) temp_logger.info(f"添加路径: {full_path}") else: temp_logger.warning(f"目录不存在: {full_path}") ``` 检查每个子目录是否存在,避免添加不存在的路径。 3. **配置导入错误处理**: ```python except ImportError as e: config = TempConfig() temp_logger.error(f"❌ 配置模块导入失败: {str(e)}") temp_logger.warning(f"⚠️ 使用临时配置") temp_logger.info(f"请检查以下路径是否存在:") temp_logger.info(f"1. {os.path.join(base_dir, 'config/config_loader.py')}") temp_logger.info(f"2. {os.path.join(base_dir, 'config/__init__.py')}") ``` 提供详细的错误信息和解决方案提示。 4. **日志目录自动创建**: ```python # 确保日志目录存在 os.makedirs(config.LOG_DIR, exist_ok=True) ``` 如果日志目录不存在,自动创建它。 5. **日志系统平滑过渡**: ```python # 移除临时日志处理器 temp_logger.removeHandler(console_handler) ``` 在正式日志系统初始化后,移除临时日志处理器。 ### 项目结构建议: 确保您的项目结构包含以下文件: ``` E:\AI_System\ ├── config\ │ ├── __init__.py ← 必须有这个文件使其成为Python包 │ └── config_loader.py ├── cognitive_arch\ │ ├── __init__.py ← 必须有这个文件 │ └── life_scheduler.py ├── agent\ │ ├── __init__.py ← 必须有这个文件 │ └── autonomous_agent.py ├── core\ │ ├── __init__.py ← 必须有这个文件 │ └── environment_interface.py ├── web_ui\ │ ├── templates\ │ └── server.py └── logs\ ← 日志目录 ``` ### `config_loader.py` 示例: 如果您还没有创建配置文件,这是一个基本示例: ```python # E:\AI_System\config\config_loader.py import os class Config: # 基础路径 BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # 智能体配置 AGENT_PATH = os.path.join(BASE_DIR, 'agent') MODEL_CACHE_DIR = os.path.join(BASE_DIR, 'model_cache') DEFAULT_MODEL = 'minimal-model' USE_GPU = False # 服务器配置 HOST = '0.0.0.0' PORT = 8000 SECRET_KEY = 'your-secret-key' LOG_LEVEL = 'INFO' LOG_DIR = os.path.join(BASE_DIR, 'logs') ENV = 'development' # 生活系统配置 LIFE_SCHEDULE = { "wake_up": "08:00", "breakfast": "08:30", "lunch": "12:30", "dinner": "19:00", "sleep": "23:00" } # 创建配置实例 config = Config() ``` ### 运行步骤: 1. **创建必要的包文件**: - 在 `config` 目录下创建 `__init__.py` 文件(可以是空文件) - 在 `cognitive_arch`、`agent`、`core` 等目录下同样创建 `__init__.py` 文件 2. **复制代码**: - 将上述完整代码复制到 `server.py` 中 3. **运行服务器**: ```bash cd E:\AI_System\web_ui python server.py ``` ### 验证成功启动的标志: 如果一切正常,您将看到类似这样的启动日志: ``` 2023-08-10 10:00:00,000 - WebServer - INFO - ================================================== 2023-08-10 10:00:00,001 - WebServer - INFO - 🚀 启动Web服务: http://0.0.0.0:8000 2023-08-10 10:00:00,001 - WebServer - INFO - 环境: development 2023-08-10 10:00:00,001 - WebServer - INFO - 日志级别: INFO 2023-08-10 10:00:00,001 - WebServer - INFO - 生活系统: ✅ 已启用 2023-08-10 10:00:00,001 - WebServer - INFO - 智能体: ✅ 已启用 2023-08-10 10:00:00,001 - WebServer - INFO - ================================================== ``` 这个修复方案确保即使在配置模块导入失败的情况下,也能正确记录日志并继续运行,同时提供了详细的错误诊断信息。
阅读全文

相关推荐

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py ✅ Eventlet monkey patch applied at startup 2025-08-12 03:04:35 [INFO ] AI_System : 系统配置初始化完成: SystemConfig(HOST=0.0.0.0, PORT=5000, LOG_LEVEL=DEBUG, DEBUG=True) 2025-08-12 03:04:35 [INFO ] AI_System : 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 03:04:35 [INFO ] AI_System : ================================================== 2025-08-12 03:04:35 [INFO ] AI_System : 🚀 开始初始化AI系统 2025-08-12 03:04:35 [INFO ] AI_System : ================================================== 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\agent 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\core 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\utils 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\config 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\cognitive_arch 2025-08-12 03:04:35 [INFO ] AI_System : 添加路径: E:\AI_System\environment 2025-08-12 03:04:35 [INFO ] AI_System : ✅ AI核心初始化 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 硬件管理器初始化 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 生活调度器初始化 2025-08-12 03:04:35 [INFO ] AI_System : 🚀 开始初始化AI智能体 2025-08-12 03:04:35,040 - CoreConfig - INFO - 📋 初始化配置管理器 | 环境前缀: AI_SYSTEM_ 2025-08-12 03:04:35,041 - CoreConfig - INFO - 🔍 加载环境变量... 2025-08-12 03:04:35,042 - CoreConfig - INFO - 📄 加载配置文件: E:\AI_System\config\system_config.json (类型: json) 2025-08-12 03:04:35,042 - CoreConfig - INFO - - 加载配置项: model = gpt-3.5-turbo 2025-08-12 03:04:35,042 - CoreConfig - INFO - - 加载配置项: api_key = ****** 2025-08-12 03:04:35,042 - CoreConfig - INFO - - 加载配置项: log_level = INFO 2025-08-12 03:04:35,042 - CoreConfig - INFO - - 加载配置项: database = {字典, 键数: 3} 2025-08-12 03:04:35,042 - CoreConfig - INFO - - 加载配置项: services = {字典, 键数: 2} 2025-08-12 03:04:35,042 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 5 2025-08-12 03:04:35,043 - CoreConfig - INFO - 📋 初始化配置管理器 | 环境前缀: AI_SYSTEM_ 2025-08-12 03:04:35,043 - CoreConfig - INFO - 🔍 加载环境变量... 2025-08-12 03:04:35,044 - CoreConfig - INFO - 📄 加载配置文件: E:\AI_System\config\system_config.json (类型: json) 2025-08-12 03:04:35,044 - CoreConfig - INFO - - 加载配置项: model = gpt-3.5-turbo 2025-08-12 03:04:35,044 - CoreConfig - INFO - - 加载配置项: api_key = ****** 2025-08-12 03:04:35,045 - CoreConfig - INFO - - 加载配置项: log_level = INFO 2025-08-12 03:04:35,045 - CoreConfig - INFO - - 加载配置项: database = {字典, 键数: 3} 2025-08-12 03:04:35,045 - CoreConfig - INFO - - 加载配置项: services = {字典, 键数: 2} 2025-08-12 03:04:35,045 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 8 2025-08-12 03:04:35 [ERROR ] AI_System : ❌ AI智能体初始化失败: stat: path should be string, bytes, os.PathLike or integer, not CoreConfig 2025-08-12 03:04:35,045 - AI_System - ERROR - ❌ AI智能体初始化失败: stat: path should be string, bytes, os.PathLike or integer, not CoreConfig 2025-08-12 03:04:35 [ERROR ] AI_System : Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 364, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 22, in <module> from core.config import system_config File "E:\AI_System\core\__init__.py", line 35, in <module> env_manager = EnvironmentManager(system_config) File "E:\AI_System\core\environment.py", line 471, in __init__ self.environment = DefaultEnvironment(base_dir) File "E:\AI_System\core\environment.py", line 362, in __init__ if not os.path.exists(base_dir): File "E:\Python310\lib\genericpath.py", line 19, in exists os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not CoreConfig 2025-08-12 03:04:35,046 - AI_System - ERROR - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 364, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 22, in <module> from core.config import system_config File "E:\AI_System\core\__init__.py", line 35, in <module> env_manager = EnvironmentManager(system_config) File "E:\AI_System\core\environment.py", line 471, in __init__ self.environment = DefaultEnvironment(base_dir) File "E:\AI_System\core\environment.py", line 362, in __init__ if not os.path.exists(base_dir): File "E:\Python310\lib\genericpath.py", line 19, in exists os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not CoreConfig 2025-08-12 03:04:35 [WARNING ] AI_System : ⚠️ 使用模拟智能体作为回退方案 2025-08-12 03:04:35,047 - AI_System - WARNING - ⚠️ 使用模拟智能体作为回退方案 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 环境管理器已启动 2025-08-12 03:04:35,047 - AI_System - INFO - ✅ 环境管理器已启动 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 环境管理器初始化成功 2025-08-12 03:04:35,047 - AI_System - INFO - ✅ 环境管理器初始化成功 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 进化监视器启动 2025-08-12 03:04:35,048 - AI_System - INFO - ✅ 进化监视器启动 2025-08-12 03:04:35 [DEBUG ] AI_System : 进化监视器运行中... 2025-08-12 03:04:35,048 - AI_System - DEBUG - 进化监视器运行中... 2025-08-12 03:04:35 [INFO ] AI_System : ✅ 所有系统组件初始化完成 2025-08-12 03:04:35,048 - AI_System - INFO - ✅ 所有系统组件初始化完成 Server initialized for eventlet. 2025-08-12 03:04:35 [INFO ] engineio.server : Server initialized for eventlet. 2025-08-12 03:04:35 [INFO ] AI_System : 🚀 开发服务器启动: http://0.0.0.0:5000 2025-08-12 03:04:35,055 - AI_System - INFO - 🚀 开发服务器启动: http://0.0.0.0:5000 (17256) wsgi starting up on http://0.0.0.0:5000 emitting event "system_event" to all [/] 2025-08-12 03:04:36 [INFO ] socketio.server : emitting event "system_event" to all [/] emitting event "system_event" to all [/] 2025-08-12 03:04:37 [INFO ] socketio.server : emitting event "system_event" to all [/] emitting event "system_event" to all [/] 2025-08-12 03:04:38 [INFO ] socketio.server : emitting event "system_event" to all [/] emitting event "system_event" to all [/] 2025-08-12 03:04:39 [INFO ] socketio.server : emitting event "system_event" to all [/] emitting event "system_event" to all [/] 2025-08-12 03:04:40 [INFO ] socketio.server : emitting event "system_event" to all [/]

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-12 04:54:19 - CoreConfig - INFO - 加载环境变量... 2025-08-12 04:54:19 - CoreConfig - WARNING - 配置文件不存在: E:\AI_System\config\system_config.yaml 2025-08-12 04:54:19 - CoreConfig - INFO - 合并默认配置... 2025-08-12 04:54:19 - CoreConfig - INFO - 创建必要目录... 2025-08-12 04:54:19 - CoreConfig - INFO - 配置加载完成 | 条目数: 11 2025-08-12 04:54:19 - CoreConfig - INFO - [OK] 配置管理器初始化完成 | 环境前缀: AI_SYSTEM_ | 基础目录: E:\AI_System 2025-08-12 04:54:19,649 - CoreInit - INFO - Core module initialization started 2025-08-12 04:54:19,649 - EnvironmentManager - INFO - 环境管理器初始化完成 (基础目录: E:\AI_System\data\environment) 2025-08-12 04:54:19,649 - CoreInit - INFO - Environment manager created: DefaultEnvironment 2025-08-12 04:54:19,649 - CoreInit - INFO - Core module initialized successfully 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志系统初始化完成 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志系统初始化完成 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志级别: INFO 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志级别: INFO 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志文件: logs/web_server.log 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 日志文件: logs/web_server.log 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - ================================================== 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - ================================================== 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开始初始化AI系统 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开始初始化AI系统 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - ================================================== 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - ================================================== 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\agent 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\agent 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\core 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\core 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\utils 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\utils 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\config 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\config 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\environment 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 添加路径: E:\AI_System\environment 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - AI核心初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - AI核心初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 硬件管理器初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 硬件管理器初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 生活调度器初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 生活调度器初始化 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开始初始化AI智能体 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开始初始化AI智能体 2025-08-12 04:54:19 - WebServer - ERROR - 6396 - 6872 - 导入 AutonomousAgent 失败: No module named 'core.subsystem_registry' 2025-08-12 04:54:19 - WebServer - ERROR - 6396 - 6872 - 导入 AutonomousAgent 失败: No module named 'core.subsystem_registry' 2025-08-12 04:54:19 - WebServer - ERROR - 6396 - 6872 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 24, in <module> from core.subsystem_registry import SubsystemRegistry ModuleNotFoundError: No module named 'core.subsystem_registry' 2025-08-12 04:54:19 - WebServer - ERROR - 6396 - 6872 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 24, in <module> from core.subsystem_registry import SubsystemRegistry ModuleNotFoundError: No module named 'core.subsystem_registry' 2025-08-12 04:54:19 - WebServer - WARNING - 6396 - 6872 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:54:19 - WebServer - WARNING - 6396 - 6872 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:54:19 - WebServer - WARNING - 6396 - 6872 - 使用模拟智能体作为回退方案 2025-08-12 04:54:19 - WebServer - WARNING - 6396 - 6872 - 使用模拟智能体作为回退方案 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器初始化成功 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器初始化成功 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器已启动 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器已启动 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器初始化成功 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 环境管理器初始化成功 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 进化监视器启动 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 进化监视器启动 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 所有系统组件初始化完成 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 所有系统组件初始化完成 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开发服务器启动: http://0.0.0.0:5000 2025-08-12 04:54:19 - WebServer - INFO - 6396 - 6872 - 开发服务器启动: http://0.0.0.0:5000 * Serving Flask app 'server' * Debug mode: off

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 加载环境变量... 2025-08-12 04:24:11 - CoreConfig - INFO - 加载配置文件: E:\AI_System\config\system_config.json (类型: json) 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置文件加载成功 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 合并默认配置... 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 15 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置管理器初始化完成 | 环境前缀: AI_SYSTEM_ | 基础目录: E:\AI_System 2025-08-12 04:24:11,140 - CoreInit - INFO - Core module initialization started 2025-08-12 04:24:11,140 - EnvironmentManager - INFO - 环境管理器初始化完成 (基础目录: E:\AI_System\data\environment) 2025-08-12 04:24:11,140 - CoreInit - INFO - Environment manager created: DefaultEnvironment 2025-08-12 04:24:11,140 - CoreInit - INFO - Core module initialized successfully 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 加载环境变量... 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 加载环境变量... 2025-08-12 04:24:11,140 - CoreConfig - INFO - 🔄 加载环境变量... --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f504' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 56, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 45, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 92, in _initialize self._load_environment() File "E:\AI_System\core\config.py", line 107, in _load_environment self.logger.info("🔄 加载环境变量...") Message: '🔄 加载环境变量...' Arguments: () 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 合并默认配置... 2025-08-12 04:24:11 - CoreConfig - INFO - 🔄 合并默认配置... 2025-08-12 04:24:11,141 - CoreConfig - INFO - 🔄 合并默认配置... --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f504' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 56, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 45, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 99, in _initialize self._merge_defaults() File "E:\AI_System\core\config.py", line 150, in _merge_defaults self.logger.info("🔄 合并默认配置...") Message: '🔄 合并默认配置...' Arguments: () 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 58 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 58 2025-08-12 04:24:11,143 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 58 --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u2705' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 56, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 45, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 101, in _initialize self.logger.info("✅ 配置加载完成 | 条目数: %d", len(self._config)) Message: '✅ 配置加载完成 | 条目数: %d' Arguments: (58,) 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置管理器初始化完成 | 环境前缀: | 基础目录: E:\AI_System 2025-08-12 04:24:11 - CoreConfig - INFO - ✅ 配置管理器初始化完成 | 环境前缀: | 基础目录: E:\AI_System 2025-08-12 04:24:11,144 - CoreConfig - INFO - ✅ 配置管理器初始化完成 | 环境前缀: | 基础目录: E:\AI_System --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u2705' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 56, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 46, in __init__ self.logger.info("✅ 配置管理器初始化完成 | 环境前缀: %s | 基础目录: %s", Message: '✅ 配置管理器初始化完成 | 环境前缀: %s | 基础目录: %s' Arguments: ('', WindowsPath('E:/AI_System')) 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志系统初始化完成 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志系统初始化完成 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志级别: INFO 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志级别: INFO 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志文件: logs/web_server.log 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 日志文件: logs/web_server.log 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - ================================================== 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - ================================================== 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开始初始化AI系统 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开始初始化AI系统 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - ================================================== 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - ================================================== 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\agent 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\agent 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\core 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\core 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\utils 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\utils 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\config 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\config 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\environment 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 添加路径: E:\AI_System\environment 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - AI核心初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - AI核心初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 硬件管理器初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 硬件管理器初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 生活调度器初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 生活调度器初始化 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开始初始化AI智能体 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开始初始化AI智能体 2025-08-12 04:24:11 - WebServer - WARNING - 3664 - 11448 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:24:11 - WebServer - WARNING - 3664 - 11448 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:24:11 - WebServer - WARNING - 3664 - 11448 - 使用模拟智能体作为回退方案 2025-08-12 04:24:11 - WebServer - WARNING - 3664 - 11448 - 使用模拟智能体作为回退方案 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器初始化成功 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器初始化成功 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器已启动 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器已启动 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器初始化成功 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 环境管理器初始化成功 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 进化监视器启动 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 进化监视器启动 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 所有系统组件初始化完成 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 所有系统组件初始化完成 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开发服务器启动: http://0.0.0.0:5000 2025-08-12 04:24:11 - WebServer - INFO - 3664 - 11448 - 开发服务器启动: http://0.0.0.0:5000 * Serving Flask app 'server' * Debug mode: off

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-12 04:52:37 - CoreConfig - INFO - 加载环境变量... 2025-08-12 04:52:37 - CoreConfig - WARNING - 配置文件不存在: E:\AI_System\config\system_config.yaml 2025-08-12 04:52:37 - CoreConfig - INFO - 合并默认配置... 2025-08-12 04:52:37 - CoreConfig - INFO - 创建必要目录... 2025-08-12 04:52:37 - CoreConfig - INFO - 配置加载完成 | 条目数: 11 2025-08-12 04:52:37 - CoreConfig - INFO - [OK] 配置管理器初始化完成 | 环境前缀: AI_SYSTEM_ | 基础目录: E:\AI_System 2025-08-12 04:52:37,641 - CoreInit - INFO - Core module initialization started 2025-08-12 04:52:37,641 - EnvironmentManager - INFO - 环境管理器初始化完成 (基础目录: E:\AI_System\data\environment) 2025-08-12 04:52:37,642 - CoreInit - INFO - Environment manager created: DefaultEnvironment 2025-08-12 04:52:37,642 - CoreInit - INFO - Core module initialized successfully 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志系统初始化完成 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志系统初始化完成 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志级别: INFO 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志级别: INFO 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志文件: logs/web_server.log 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 日志文件: logs/web_server.log 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - ================================================== 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - ================================================== 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开始初始化AI系统 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开始初始化AI系统 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - ================================================== 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - ================================================== 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\agent 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\agent 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\core 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\core 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\utils 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\utils 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\config 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\config 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\environment 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 添加路径: E:\AI_System\environment 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - AI核心初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - AI核心初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 硬件管理器初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 硬件管理器初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 生活调度器初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 生活调度器初始化 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开始初始化AI智能体 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开始初始化AI智能体 2025-08-12 04:52:37 - WebServer - ERROR - 12916 - 11196 - 导入 AutonomousAgent 失败: cannot import name 'CircuitBreaker' from 'core.circuit_breaker' (E:\AI_System\core\circuit_breaker.py) 2025-08-12 04:52:37 - WebServer - ERROR - 12916 - 11196 - 导入 AutonomousAgent 失败: cannot import name 'CircuitBreaker' from 'core.circuit_breaker' (E:\AI_System\core\circuit_breaker.py) 2025-08-12 04:52:37 - WebServer - ERROR - 12916 - 11196 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 23, in <module> from core.circuit_breaker import CircuitBreaker ImportError: cannot import name 'CircuitBreaker' from 'core.circuit_breaker' (E:\AI_System\core\circuit_breaker.py) 2025-08-12 04:52:37 - WebServer - ERROR - 12916 - 11196 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 23, in <module> from core.circuit_breaker import CircuitBreaker ImportError: cannot import name 'CircuitBreaker' from 'core.circuit_breaker' (E:\AI_System\core\circuit_breaker.py) 2025-08-12 04:52:37 - WebServer - WARNING - 12916 - 11196 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:52:37 - WebServer - WARNING - 12916 - 11196 - 无法导入AutonomousAgent,使用模拟智能体 2025-08-12 04:52:37 - WebServer - WARNING - 12916 - 11196 - 使用模拟智能体作为回退方案 2025-08-12 04:52:37 - WebServer - WARNING - 12916 - 11196 - 使用模拟智能体作为回退方案 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器初始化成功 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器初始化成功 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器已启动 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器已启动 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器初始化成功 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 环境管理器初始化成功 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 进化监视器启动 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 进化监视器启动 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 所有系统组件初始化完成 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 所有系统组件初始化完成 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开发服务器启动: http://0.0.0.0:5000 2025-08-12 04:52:37 - WebServer - INFO - 12916 - 11196 - 开发服务器启动: http://0.0.0.0:5000 * Serving Flask app 'server' * Debug mode: off

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-12 04:55:59 - CoreConfig - INFO - 加载环境变量... 2025-08-12 04:55:59 - CoreConfig - WARNING - 配置文件不存在: E:\AI_System\config\system_config.yaml 2025-08-12 04:55:59 - CoreConfig - INFO - 合并默认配置... 2025-08-12 04:55:59 - CoreConfig - INFO - 创建必要目录... 2025-08-12 04:55:59 - CoreConfig - INFO - 配置加载完成 | 条目数: 11 2025-08-12 04:55:59 - CoreConfig - INFO - [OK] 配置管理器初始化完成 | 环境前缀: AI_SYSTEM_ | 基础目录: E:\AI_System 2025-08-12 04:55:59,043 - CoreInit - INFO - Core module initialization started 2025-08-12 04:55:59,043 - EnvironmentManager - INFO - 环境管理器初始化完成 (基础目录: E:\AI_System\data\environment) 2025-08-12 04:55:59,043 - CoreInit - INFO - Environment manager created: DefaultEnvironment 2025-08-12 04:55:59,043 - CoreInit - INFO - Core module initialized successfully 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志系统初始化完成 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志系统初始化完成 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志级别: INFO 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志级别: INFO 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志文件: logs/web_server.log 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 日志文件: logs/web_server.log 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 系统初始化器创建, 基础目录: E:\AI_System 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - ================================================== 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - ================================================== 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开始初始化AI系统 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开始初始化AI系统 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - ================================================== 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - ================================================== 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\agent 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\agent 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\core 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\core 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\utils 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\utils 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\config 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\config 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\cognitive_arch 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\environment 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 添加路径: E:\AI_System\environment 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - AI核心初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - AI核心初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 硬件管理器初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 硬件管理器初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 生活调度器初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 生活调度器初始化 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开始初始化AI智能体 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开始初始化AI智能体 2025-08-12 04:55:59 - WebServer - ERROR - 16180 - 18188 - AI智能体初始化失败: 配置项 'MAX_WORKERS' 不存在 2025-08-12 04:55:59 - WebServer - ERROR - 16180 - 18188 - AI智能体初始化失败: 配置项 'MAX_WORKERS' 不存在 2025-08-12 04:55:59 - WebServer - ERROR - 16180 - 18188 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 27, in <module> executor = ThreadPoolExecutor(max_workers=system_config.MAX_WORKERS) File "E:\AI_System\core\config.py", line 431, in __getattr__ raise AttributeError( AttributeError: 配置项 'MAX_WORKERS' 不存在 2025-08-12 04:55:59 - WebServer - ERROR - 16180 - 18188 - Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 460, in initialize_ai_agent from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 27, in <module> executor = ThreadPoolExecutor(max_workers=system_config.MAX_WORKERS) File "E:\AI_System\core\config.py", line 431, in __getattr__ raise AttributeError( AttributeError: 配置项 'MAX_WORKERS' 不存在 2025-08-12 04:55:59 - WebServer - WARNING - 16180 - 18188 - 使用模拟智能体作为回退方案 2025-08-12 04:55:59 - WebServer - WARNING - 16180 - 18188 - 使用模拟智能体作为回退方案 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器初始化成功 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器初始化成功 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器已启动 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器已启动 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器初始化成功 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 环境管理器初始化成功 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 进化监视器启动 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 进化监视器启动 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 所有系统组件初始化完成 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 所有系统组件初始化完成 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开发服务器启动: http://0.0.0.0:5000 2025-08-12 04:55:59 - WebServer - INFO - 16180 - 18188 - 开发服务器启动: http://0.0.0.0:5000 * Serving Flask app 'server' * Debug mode: off

http://127.0.0.1:5000/ 显示:“{ "error": "\u8d44\u6e90\u672a\u627e\u5230", "message": "404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again." }” 小黑窗显示:“ File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f3e2' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\agent\agent_core.py", line 24, in <module> from agent.cognitive_architecture import CognitiveArchitecture File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "E:\AI_System\agent\autonomous_agent.py", line 19, in <module> from core.config import system_config File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "E:\AI_System\core\config.py", line 329, in <module> system_config = CoreConfig() File "E:\AI_System\core\config.py", line 81, in __init__ self.log_config() File "E:\AI_System\core\config.py", line 316, in log_config logger.info("🏢 核心配置摘要:") Message: '🏢 核心配置摘要:' Arguments: () 2025-08-11 21:49:50,262 - CoreConfig - INFO - 🏢 核心配置摘要: 2025-08-11 21:49:50,264 - CoreConfig - INFO - AI系统路径: E:\AI_Workspace 2025-08-11 21:49:50,264 - CoreConfig - INFO - AI系统路径: E:\AI_Workspace 2025-08-11 21:49:50,264 - CoreConfig - INFO - 临时文件路径: E:\AI_Workspace\ai_temp 2025-08-11 21:49:50,264 - CoreConfig - INFO - 临时文件路径: E:\AI_Workspace\ai_temp 2025-08-11 21:49:50,264 - CoreConfig - INFO - 代理路径: E:\AI_System\agent 2025-08-11 21:49:50,264 - CoreConfig - INFO - 代理路径: E:\AI_System\agent 2025-08-11 21:49:50,264 - CoreConfig - INFO - Web UI路径: E:\AI_System\web_ui 2025-08-11 21:49:50,264 - CoreConfig - INFO - Web UI路径: E:\AI_System\web_ui 2025-08-11 21:49:50,264 - CoreConfig - INFO - 模型目录: E:\ai_temp\models 2025-08-11 21:49:50,264 - CoreConfig - INFO - 模型目录: E:\ai_temp\models 2025-08-11 21:49:50,264 - CoreConfig - INFO - 默认模型: qwen2-7b (设备: cpu, 使用GPU: True) 2025-08-11 21:49:50,264 - CoreConfig - INFO - 默认模型: qwen2-7b (设备: cpu, 使用GPU: True) 2025-08-11 21:49:50,264 - CoreConfig - INFO - 日志级别: 20 (日志目录: E:\AI_System\logs) 2025-08-11 21:49:50,264 - CoreConfig - INFO - 日志级别: 20 (日志目录: E:\AI_System\logs) 2025-08-11 21:49:50,265 - CoreConfig - INFO - 熔断阈值: 5 2025-08-11 21:49:50,265 - CoreConfig - INFO - 熔断阈值: 5 2025-08-11 21:49:50,265 - CoreConfig - INFO - ============================================================ 2025-08-11 21:49:50,265 - CoreConfig - INFO - ============================================================ Traceback (most recent call last): File "E:\AI_System\agent\agent_core.py", line 24, in <module> from agent.cognitive_architecture import CognitiveArchitecture File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 20, in <module> from core.exceptions import DependencyError, SubsystemFailure ImportError: cannot import name 'SubsystemFailure' from 'core.exceptions' (E:\AI_System\core\exceptions.py) [3/3] 启动用户界面... 系统启动完成!自动打开监控页面... ✅ Eventlet monkey patch applied at startup 2025-08-11 21:49:53 [INFO] WebServer: ================================================== 2025-08-11 21:49:53 [INFO] WebServer: 🚀 开始初始化AI系统 2025-08-11 21:49:53 [INFO] WebServer: ================================================== 2025-08-11 21:49:53 [INFO] WebServer: 项目根目录: E:\AI_System 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\agent 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\core 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\utils 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\config 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\cognitive_arch 2025-08-11 21:49:53 [INFO] WebServer: 添加路径: E:\AI_System\environment 2025-08-11 21:49:53 [INFO] WebServer: ✅ 模拟AI核心初始化 2025-08-11 21:49:53 [INFO] WebServer: ✅ 模拟硬件管理器初始化 2025-08-11 21:49:53 [INFO] WebServer: ✅ 模拟生活调度器初始化 2025-08-11 21:49:53 [INFO] WebServer: ✅ 模拟AI智能体初始化 2025-08-11 21:49:53 [INFO] WebServer: 环境管理器已启动 2025-08-11 21:49:53 [INFO] WebServer: ✅ 环境管理器初始化成功 2025-08-11 21:49:53 [INFO] WebServer: ✅ 模拟进化监视器启动 2025-08-11 21:49:53 [INFO] WebServer: ✅ 所有系统组件初始化完成 2025-08-11 21:49:53 [INFO] WebServer: ✅ 使用eventlet异步模式 Server initialized for eventlet. 2025-08-11 21:49:53 [INFO] WebServer: 开发服务器运行在 http://0.0.0.0:5000 (14832) wsgi starting up on http://0.0.0.0:5000 ================================================ 运行中进程: python.exe 8532 Console 1 211,552 K python.exe 14832 Console 1 50,572 K ================================================ 按任意键退出此窗口(服务将继续在后台运行)... (14832) accepted ('127.0.0.1', 50710) 127.0.0.1 - - [11/Aug/2025 22:04:34] "GET / HTTP/1.1" 404 340 0.000997 (14832) accepted ('127.0.0.1', 50713) 127.0.0.1 - - [11/Aug/2025 22:04:34] "GET /favicon.ico HTTP/1.1" 404 212 0.001000 127.0.0.1 - - [11/Aug/2025 22:08:27] "GET / HTTP/1.1" 404 340 0.000997 (14832) accepted ('127.0.0.1', 50750)”我应该做什么

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-09 21:59:53,638 - StartupLogger - INFO - 项目根目录: E:\AI_System 2025-08-09 21:59:53,639 - StartupLogger - INFO - 添加路径: E:\AI_System\agent 2025-08-09 21:59:53,639 - StartupLogger - INFO - 添加路径: E:\AI_System\core 2025-08-09 21:59:53,639 - StartupLogger - INFO - 添加路径: E:\AI_System\utils 2025-08-09 21:59:53,639 - StartupLogger - INFO - 添加路径: E:\AI_System\config 2025-08-09 21:59:53,639 - StartupLogger - INFO - 添加路径: E:\AI_System\cognitive_arch 2025-08-09 21:59:53,642 - StartupLogger - ERROR - ❌ 配置模块导入失败: No module named 'config.config_loader'; 'config' is not a package 2025-08-09 21:59:53,642 - StartupLogger - WARNING - ⚠️ 使用临时配置 2025-08-09 21:59:53,642 - StartupLogger - INFO - 请检查以下路径是否存在: 2025-08-09 21:59:53,642 - StartupLogger - INFO - 1. E:\AI_System\config\config_loader.py 2025-08-09 21:59:53,642 - StartupLogger - INFO - 2. E:\AI_System\config\__init__.py 2025-08-09 21:59:53,643 - WebServer - ERROR - ❌ 生活系统初始化失败: LifeScheduler() takes no arguments Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 159, in <module> life_scheduler = LifeScheduler( TypeError: LifeScheduler() takes no arguments 2025-08-09 21:59:53,644 - WebServer - WARNING - ⚠️ 生活系统功能将不可用 2025-08-09 21:59:53,644 - WebServer - INFO - ================================================== 2025-08-09 21:59:53,644 - WebServer - INFO - 正在使用统一配置初始化智能体核心模块... 2025-08-09 21:59:53,644 - WebServer - INFO - 智能体路径: E:\AI_System\agent 2025-08-09 21:59:53,644 - WebServer - INFO - 模型缓存目录: E:\AI_System\model_cache 2025-08-09 21:59:53,644 - WebServer - INFO - 默认模型: minimal-model 2025-08-09 21:59:53,644 - WebServer - INFO - 使用GPU: False 2025-08-09 21:59:53,647 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 21:59:53,647 - WebServer - INFO - ⏳ 2秒后重试... 2025-08-09 21:59:55,662 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 21:59:55,663 - WebServer - INFO - ⏳ 2秒后重试... 2025-08-09 21:59:57,676 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 21:59:57,676 - WebServer - CRITICAL - ‼️ 智能体模块导入彻底失败 2025-08-09 21:59:57,682 - WebServer - INFO - ================================================== 2025-08-09 21:59:57,682 - WebServer - INFO - 🚀 启动Web服务: http://0.0.0.0:8000 2025-08-09 21:59:57,682 - WebServer - INFO - 环境: development 2025-08-09 21:59:57,683 - WebServer - INFO - 日志级别: INFO 2025-08-09 21:59:57,683 - WebServer - INFO - 生活系统: ❌ 未启用 2025-08-09 21:59:57,683 - WebServer - INFO - 智能体: ❌ 未启用 2025-08-09 21:59:57,683 - WebServer - INFO - ================================================== * Serving Flask app 'server' * Debug mode: on WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:8000 * Running on http://192.168.10.146:8000 Press CTRL+C to quit * Restarting with stat 2025-08-09 21:59:57,817 - StartupLogger - INFO - 项目根目录: E:\AI_System 2025-08-09 21:59:57,817 - StartupLogger - INFO - 添加路径: E:\AI_System\agent 2025-08-09 21:59:57,817 - StartupLogger - INFO - 添加路径: E:\AI_System\core 2025-08-09 21:59:57,817 - StartupLogger - INFO - 添加路径: E:\AI_System\utils 2025-08-09 21:59:57,817 - StartupLogger - INFO - 添加路径: E:\AI_System\config 2025-08-09 21:59:57,817 - StartupLogger - INFO - 添加路径: E:\AI_System\cognitive_arch 2025-08-09 21:59:57,821 - StartupLogger - ERROR - ❌ 配置模块导入失败: No module named 'config.config_loader'; 'config' is not a package 2025-08-09 21:59:57,821 - StartupLogger - WARNING - ⚠️ 使用临时配置 2025-08-09 21:59:57,821 - StartupLogger - INFO - 请检查以下路径是否存在: 2025-08-09 21:59:57,821 - StartupLogger - INFO - 1. E:\AI_System\config\config_loader.py 2025-08-09 21:59:57,821 - StartupLogger - INFO - 2. E:\AI_System\config\__init__.py 2025-08-09 21:59:57,822 - WebServer - ERROR - ❌ 生活系统初始化失败: LifeScheduler() takes no arguments Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 159, in <module> life_scheduler = LifeScheduler( TypeError: LifeScheduler() takes no arguments 2025-08-09 21:59:57,823 - WebServer - WARNING - ⚠️ 生活系统功能将不可用 2025-08-09 21:59:57,823 - WebServer - INFO - ================================================== 2025-08-09 21:59:57,823 - WebServer - INFO - 正在使用统一配置初始化智能体核心模块... 2025-08-09 21:59:57,823 - WebServer - INFO - 智能体路径: E:\AI_System\agent 2025-08-09 21:59:57,823 - WebServer - INFO - 模型缓存目录: E:\AI_System\model_cache 2025-08-09 21:59:57,823 - WebServer - INFO - 默认模型: minimal-model 2025-08-09 21:59:57,824 - WebServer - INFO - 使用GPU: False 2025-08-09 21:59:57,825 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 21:59:57,825 - WebServer - INFO - ⏳ 2秒后重试... 2025-08-09 21:59:59,833 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 22:00:00,271 - WebServer - INFO - ⏳ 2秒后重试... 2025-08-09 22:00:03,084 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.config_loader' 2025-08-09 22:00:03,084 - WebServer - CRITICAL - ‼️ 智能体模块导入彻底失败 2025-08-09 22:00:03,092 - WebServer - INFO - ================================================== 2025-08-09 22:00:03,092 - WebServer - INFO - 🚀 启动Web服务: http://0.0.0.0:8000 2025-08-09 22:00:03,093 - WebServer - INFO - 环境: development 2025-08-09 22:00:03,094 - WebServer - INFO - 日志级别: INFO 2025-08-09 22:00:03,095 - WebServer - INFO - 生活系统: ❌ 未启用 2025-08-09 22:00:03,095 - WebServer - INFO - 智能体: ❌ 未启用 2025-08-09 22:00:03,095 - WebServer - INFO - ================================================== * Debugger is active! * Debugger PIN: 762-269-022

# core/config.py import os import json import logging from pathlib import Path from typing import Dict, Any, Optional, Union import hashlib import sys class CoreConfig: """核心配置管理器 - 完全修复版""" def __init__(self, config_path: Union[str, Path] = None, env_prefix: str = "", default_config: Dict = None): # 1. 直接存储基本属性 self.env_prefix = env_prefix self.config_path = Path(config_path) if config_path else None self.default_config = default_config or {} self._config = {} self._last_hash = None # 2. 确定基础目录(不依赖属性访问) self.BASE_DIR = self._determine_base_dir() # 3. 初始化基本配置 self._config = { 'BASE_DIR': str(self.BASE_DIR), 'LOG_DIR': str(self.BASE_DIR / "logs"), 'CONFIG_DIR': str(self.BASE_DIR / "config"), 'CACHE_DIR': str(self.BASE_DIR / "cache"), 'DATA_DIR': str(self.BASE_DIR / "data"), 'MODEL_DIR': str(self.BASE_DIR / "models"), } # 4. 初始化日志器 self.logger = self._create_safe_logger() # 5. 完成初始化 self._initialize() self.logger.info("✅ 配置管理器初始化完成 | 环境前缀: %s | 基础目录: %s", self.env_prefix, self.BASE_DIR) def _determine_base_dir(self) -> Path: """确定基础目录(安全无递归)""" # 1. 尝试环境变量 base_dir_env = os.getenv(f"{self.env_prefix}BASE_DIR") if base_dir_env: return Path(base_dir_env).resolve() # 2. 尝试文件位置 try: return Path(__file__).parent.parent.resolve() except Exception: return Path.cwd().resolve() # 3. 默认当前目录 return Path.cwd().resolve() def _create_safe_logger(self) -> logging.Logger: """创建安全的日志器(Windows兼容)""" logger = logging.getLogger('CoreConfig') logger.setLevel(logging.INFO) # 安全控制台处理器 class SafeConsoleHandler(logging.StreamHandler): def emit(self, record): try: msg = self.format(record) safe_msg = msg.encode('utf-8', errors='replace').decode('utf-8') self.stream.write(safe_msg + self.terminator) self.flush() except Exception: self.handleError(record) console_handler = SafeConsoleHandler() formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s', '%Y-%m-%d %H:%M:%S' ) console_handler.setFormatter(formatter) logger.addHandler(console_handler) return logger def _initialize(self): """初始化配置流程""" try: self._load_environment() if self.config_path and self.config_path.exists(): self._load_config_file() elif self.config_path: self.logger.warning("⚠️ 配置文件不存在: %s", self.config_path) self._merge_defaults() self._create_directories() self.logger.info("✅ 配置加载完成 | 条目数: %d", len(self._config)) except Exception as e: self.logger.error("❌ 配置初始化失败: %s", str(e)) def _load_environment(self): """加载环境变量到配置""" self.logger.info("🔄 加载环境变量...") for key, value in os.environ.items(): if key.startswith(self.env_prefix): config_key = key[len(self.env_prefix):].lower() self._config[config_key] = value self.logger.debug("加载环境变量: %s = %s", config_key, value) # 其他方法保持不变... def __getattr__(self, name: str) -> Any: """安全属性访问方法""" # 1. 检查配置字典 if name in self._config: return self._config[name] # 2. 检查嵌套属性 (key.subkey) if '.' in name: parts = name.split('.') current = self._config for part in parts: if isinstance(current, dict) and part in current: current = current[part] else: break else: # 所有部分都存在 return current # 3. 尝试直接访问实例属性 try: return object.__getattribute__(self, name) except AttributeError: # 4. 抛出明确异常 raise AttributeError( f"属性 '{name}' 在 {type(self).__name__} 对象中不存在" ) from None E:\AI_System\web_ui>python server.py 2025-08-12 04:19:38 - CoreConfig - INFO - 🔄 加载环境变量... 2025-08-12 04:19:38 - CoreConfig - ERROR - ❌ 配置初始化失败: 属性 '_load_config_file' 在 CoreConfig 对象中不存在 2025-08-12 04:19:38 - CoreConfig - INFO - ✅ 配置管理器初始化完成 | 环境前缀: AI_SYSTEM_ | 基础目录: E:\AI_System Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 53, in <module> from core.config import CoreConfig as SystemConfig File "E:\AI_System\core\__init__.py", line 37, in <module> level=system_config.get("logging.level", "INFO"), File "E:\AI_System\core\config.py", line 137, in __getattr__ raise AttributeError( AttributeError: 属性 'get' 在 CoreConfig 对象中不存在

E:\AI_System\core\environment.py import os import json import logging import time import datetime from pathlib import Path from typing import Dict, Any, Optional class EnvironmentManager: """环境管理器,负责维护环境状态并执行环境操作""" def __init__(self, base_dir: Path): """ 初始化环境管理器 Args: base_dir: 基础目录路径 (Path对象) """ # 验证路径类型 if not isinstance(base_dir, Path): raise TypeError("base_dir 必须是 Path 对象") self.base_dir = base_dir self.status_file = self.base_dir / 'environment_status.json' self.state = self._load_state() self.is_healthy = True self.logger = logging.getLogger('EnvironmentManager') self.logger.info(f"环境管理器初始化完成 (基础目录: {self.base_dir})") def _load_state(self) -> Dict[str, Any]: """从文件加载环境状态""" # 确保目录存在 self.base_dir.mkdir(parents=True, exist_ok=True) if self.status_file.exists(): try: with open(self.status_file, 'r') as f: return json.load(f) except Exception as e: self.logger.error(f"加载环境状态失败: {str(e)}") # 默认状态 return { "temperature": 22.5, "humidity": 45.0, "light_level": 75, "objects": [], "last_updated": "" } def save_state(self): """保存当前环境状态到文件""" try: with open(self.status_file, 'w') as f: json.dump(self.state, f, indent=2) self.logger.debug(f"环境状态已保存到: {self.status_file}") return True except Exception as e: self.logger.error(f"保存环境状态失败: {str(e)}") return False def get_state(self) -> Dict[str, Any]: """获取当前环境状态""" # 更新模拟数据 self.state['temperature'] = round(20 + 5 * (time.time() % 10) / 10, 1) self.state['humidity'] = round(40 + 10 * (time.time() % 10) / 10, 1) self.state['light_level'] = round(70 + 10 * (time.time() % 10) / 10, 1) self.state['last_updated'] = datetime.datetime.now().isoformat() return self.state def execute_action(self, action: str, params: Dict) -> bool: """执行环境动作 Args: action: 动作名称 (adjust_temperature, adjust_light, add_object, remove_object) params: 动作参数 Returns: bool: 动作是否执行成功 """ self.logger.info(f"执行环境动作: {action} 参数: {params}") try: if action == "adjust_temperature": return self._adjust_temperature(params) elif action == "adjust_light": return self._adjust_light(params) elif action == "add_object": return self._add_object(params) elif action == "remove_object": return self._remove_object(params) else: self.logger.warning(f"未知动作: {action}") return False except Exception as e: self.logger.error(f"执行动作失败: {str(e)}") return False def _adjust_temperature(self, params: Dict) -> bool: """调整温度""" value = params.get('value') if value is None: self.logger.warning("缺少温度值参数") return False try: value = float(value) except ValueError: self.logger.warning(f"无效的温度值: {value}") return False if 10 <= value <= 40: self.state['temperature'] = value self.save_state() return True self.logger.warning(f"温度值超出范围 (10-40): {value}") return False def _adjust_light(self, params: Dict) -> bool: """调整光照强度""" level = params.get('level') if level is None: self.logger.warning("缺少光照强度参数") return False try: level = float(level) except ValueError: self.logger.warning(f"无效的光照强度: {level}") return False if 0 <= level <= 100: self.state['light_level'] = level self.save_state() return True self.logger.warning(f"光照强度超出范围 (0-100): {level}") return False def _add_object(self, params: Dict) -> bool: """添加环境对象""" obj_name = params.get('name') if not obj_name: self.logger.warning("缺少对象名称") return False obj_type = params.get('type', 'object') position = params.get('position', 'unknown') # 检查是否已存在 for obj in self.state['objects']: if obj['name'] == obj_name: self.logger.warning(f"对象已存在: {obj_name}") return False # 添加新对象 self.state['objects'].append({ 'name': obj_name, 'type': obj_type, 'position': position, 'added_at': datetime.datetime.now().isoformat() }) self.save_state() return True def _remove_object(self, params: Dict) -> bool: """移除环境对象""" obj_name = params.get('name') if not obj_name: self.logger.warning("缺少对象名称") return False # 查找并移除对象 for i, obj in enumerate(self.state['objects']): if obj['name'] == obj_name: del self.state['objects'][i] self.save_state() return True self.logger.warning(f"未找到对象: {obj_name}") return False def is_healthy(self) -> bool: """检查环境是否健康""" # 简单检查:确保所有值在合理范围内 temp = self.state['temperature'] light = self.state['light_level'] if temp < 10 or temp > 40: self.logger.warning(f"温度超出健康范围: {temp}℃") return False if light < 0 or light > 100: self.logger.warning(f"光照强度超出健康范围: {light}%") return False return True # E:\AI_System\core\environment_interface.py from .environment import EnvironmentInterface, DefaultEnvironment # 暴露接口类 __all__ = ['EnvironmentInterface', 'DefaultEnvironment'] # E:\AI_System\core\__init__.py import os from pathlib import Path from .environment import EnvironmentInterface, DefaultEnvironment, EnvironmentManager from .environment_interface import EnvironmentInterface as EnvInterface from .config import CoreConfig # 获取项目根目录 BASE_DIR = Path(__file__).resolve().parent.parent # 创建全局配置实例 system_config = CoreConfig( config_path=BASE_DIR / "config" / "system_config.json", env_prefix="AI_SYSTEM_", default_config={ "app": { "name": "AI_System", "version": "1.0.0", "root_dir": str(BASE_DIR) # 添加项目根目录到配置 }, "logging": { "level": "INFO", "file": str(BASE_DIR / "logs" / "app.log") }, "environment": { "type": "development" if os.getenv("DEBUG") else "production" } } ) # 提供兼容性导入 EnvironmentInterface = EnvInterface # 初始化环境管理器 env_manager = EnvironmentManager(system_config) # 导出核心模块的公共接口 __all__ = [ "EnvironmentInterface", "DefaultEnvironment", "EnvironmentManager", "system_config", "CoreConfig", "env_manager" ] # 初始化日志系统 if __name__ != "__main__": import logging from logging.config import dictConfig log_config = { "version": 1, "disable_existing_loggers": False, "formatters": { "standard": { "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" } }, "handlers": { "console": { "class": "logging.StreamHandler", "level": system_config.get("logging.level", "INFO"), "formatter": "standard" }, "file": { "class": "logging.FileHandler", "filename": system_config.get("logging.file", "app.log"), "level": "DEBUG", "formatter": "standard" } }, "loggers": { "": { # root logger "handlers": ["console", "file"], "level": "DEBUG", "propagate": True } } } dictConfig(log_config) logging.info("Core module initialized") E:\AI_System\web_ui>python server.py Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 19, in <module> from core.config import CoreConfig as SystemConfig File "E:\AI_System\core\__init__.py", line 4, in <module> from .environment import EnvironmentInterface, DefaultEnvironment, EnvironmentManager ImportError: cannot import name 'EnvironmentInterface' from 'core.environment' (E:\AI_System\core\environment.py)

E:\AI_System\web_ui>python server.py ERROR:root:❌ 配置模块导入失败: No module named 'config.config_loader'; 'config' is not a package ERROR:root:请检查以下路径是否存在: ERROR:root:1. E:\AI_System\config/config_loader.py --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 90, in <module> from cognitive_arch.life_scheduler import LifeScheduler ModuleNotFoundError: No module named 'cognitive_arch' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u274c' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 128, in <module> logger.error(f"❌ 生活系统模块导入失败: {str(e)}") Message: "❌ 生活系统模块导入失败: No module named 'cognitive_arch'" Arguments: () 2025-08-09 20:09:52,631 - WebServer - ERROR - ❌ 生活系统模块导入失败: No module named 'cognitive_arch' ERROR:WebServer:❌ 生活系统模块导入失败: No module named 'cognitive_arch' 2025-08-09 20:09:52,640 - WebServer - WARNING - 生活系统功能将不可用 WARNING:WebServer:生活系统功能将不可用 2025-08-09 20:09:52,640 - WebServer - INFO - ================================================== INFO:WebServer:================================================== 2025-08-09 20:09:52,641 - WebServer - INFO - 正在使用统一配置初始化智能体核心模块... INFO:WebServer:正在使用统一配置初始化智能体核心模块... 2025-08-09 20:09:52,641 - WebServer - INFO - 智能体路径: E:\AI_System\agent INFO:WebServer:智能体路径: E:\AI_System\agent 2025-08-09 20:09:52,641 - WebServer - INFO - 模型缓存目录: E:\AI_System\model_cache INFO:WebServer:模型缓存目录: E:\AI_System\model_cache 2025-08-09 20:09:52,641 - WebServer - INFO - 默认模型: minimal-model INFO:WebServer:默认模型: minimal-model 2025-08-09 20:09:52,641 - WebServer - INFO - 使用GPU: False INFO:WebServer:使用GPU: False --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u274c' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 159, in <module> logger.error(f"❌ 智能体模块导入失败: {str(ie)}") Message: "❌ 智能体模块导入失败: No module named 'core.environment_interface'" Arguments: () 2025-08-09 20:09:52,650 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.environment_interface' ERROR:WebServer:❌ 智能体模块导入失败: No module named 'core.environment_interface' --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u23f3' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 161, in <module> logger.info(f"⏳ {retry_delay}秒后重试...") Message: '⏳ 2秒后重试...' Arguments: () 2025-08-09 20:09:52,653 - WebServer - INFO - ⏳ 2秒后重试... INFO:WebServer:⏳ 2秒后重试... --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u274c' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 159, in <module> logger.error(f"❌ 智能体模块导入失败: {str(ie)}") Message: "❌ 智能体模块导入失败: No module named 'core.environment_interface'" Arguments: () 2025-08-09 20:09:54,671 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.environment_interface' ERROR:WebServer:❌ 智能体模块导入失败: No module named 'core.environment_interface' --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u23f3' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 161, in <module> logger.info(f"⏳ {retry_delay}秒后重试...") Message: '⏳ 2秒后重试...' Arguments: () 2025-08-09 20:09:54,677 - WebServer - INFO - ⏳ 2秒后重试... INFO:WebServer:⏳ 2秒后重试... --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u274c' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 159, in <module> logger.error(f"❌ 智能体模块导入失败: {str(ie)}") Message: "❌ 智能体模块导入失败: No module named 'core.environment_interface'" Arguments: () 2025-08-09 20:09:56,691 - WebServer - ERROR - ❌ 智能体模块导入失败: No module named 'core.environment_interface' ERROR:WebServer:❌ 智能体模块导入失败: No module named 'core.environment_interface' --- Logging error --- Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 148, in <module> from agent.autonomous_agent import AutonomousAgent File "E:\AI_System\agent\__init__.py", line 5, in <module> from .autonomous_agent import AutonomousAgent # 修改此处 File "E:\AI_System\agent\autonomous_agent.py", line 10, in <module> from core.environment_interface import EnvironmentInterface ModuleNotFoundError: No module named 'core.environment_interface' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u203c' in position 49: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 164, in <module> logger.critical("‼️ 智能体模块导入彻底失败") Message: '‼️ 智能体模块导入彻底失败' Arguments: () 2025-08-09 20:09:56,697 - WebServer - CRITICAL - ‼️ 智能体模块导入彻底失败 CRITICAL:WebServer:‼️ 智能体模块导入彻底失败 2025-08-09 20:09:56,704 - WebServer - INFO - ================================================== INFO:WebServer:================================================== --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f680' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 734, in <module> logger.info(f"🚀 启动Web服务: http://{config.HOST}:{config.PORT}") Message: '🚀 启动Web服务: http://0.0.0.0:8000' Arguments: () 2025-08-09 20:09:56,704 - WebServer - INFO - 🚀 启动Web服务: http://0.0.0.0:8000 INFO:WebServer:🚀 启动Web服务: http://0.0.0.0:8000 Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 735, in <module> logger.info(f"环境: {config.ENV}") AttributeError: 'TempConfig' object has no attribute 'ENV'

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py 2025-08-12 03:55:11,438 - CoreInit - INFO - Core module initialization started 2025-08-12 03:55:11,438 - EnvironmentManager - INFO - 环境管理器初始化完成 (基础目录: E:\AI_System\data\environment) 2025-08-12 03:55:11,438 - CoreInit - INFO - Environment manager created: DefaultEnvironment 2025-08-12 03:55:11,438 - CoreInit - INFO - Core module initialized successfully 2025-08-12 03:55:11,447 - CoreConfig - INFO - 📋 初始化配置管理器 | 环境前缀: | 基础目录: E:\AI_System\web_ui --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f4cb' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 23, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 40, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 44, in _initialize self.logger.info(f"📋 初始化配置管理器 | 环境前缀: {self.env_prefix} | 基础目录: {Path.cwd()}") Message: '📋 初始化配置管理器 | 环境前缀: | 基础目录: E:\\AI_System\\web_ui' Arguments: () 2025-08-12 03:55:11,448 - CoreConfig - INFO - 🔍 加载环境变量... --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f50d' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 23, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 40, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 47, in _initialize self._load_environment() File "E:\AI_System\core\config.py", line 63, in _load_environment self.logger.info("🔍 加载环境变量...") Message: '🔍 加载环境变量...' Arguments: () 2025-08-12 03:55:11,449 - CoreConfig - WARNING - ⚠️ 配置文件不存在: None --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u26a0' in position 49: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 23, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 40, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 53, in _initialize self.logger.warning(f"⚠️ 配置文件不存在: {self.config_path}") Message: '⚠️ 配置文件不存在: None' Arguments: () 2025-08-12 03:55:11,452 - CoreConfig - INFO - 🔄 合并默认配置... --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f504' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 23, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 40, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 56, in _initialize self._merge_defaults() File "E:\AI_System\core\config.py", line 126, in _merge_defaults self.logger.info("🔄 合并默认配置...") Message: '🔄 合并默认配置...' Arguments: () 2025-08-12 03:55:11,454 - CoreConfig - INFO - ✅ 配置加载完成 | 条目数: 52 --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u2705' in position 46: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 23, in <module> system_config = SystemConfig() File "E:\AI_System\core\config.py", line 40, in __init__ self._initialize() File "E:\AI_System\core\config.py", line 56, in _initialize self._merge_defaults() File "E:\AI_System\core\config.py", line 128, in _merge_defaults self.logger.info(f"✅ 配置加载完成 | 条目数: {len(self._config)}") Message: '✅ 配置加载完成 | 条目数: 52' Arguments: () 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - ✅ 日志系统初始化完成 2025-08-12 03:55:11,455 - WebServer - INFO - ✅ 日志系统初始化完成 --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\u2705' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 95, in <module> logger = setup_logger() File "E:\AI_System\web_ui\server.py", line 87, in setup_logger logger.info("✅ 日志系统初始化完成") Message: '✅ 日志系统初始化完成' Arguments: () 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - ✅ 日志系统初始化完成 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - 📝 日志级别: INFO 2025-08-12 03:55:11,456 - WebServer - INFO - 📝 日志级别: INFO --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f4dd' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 95, in <module> logger = setup_logger() File "E:\AI_System\web_ui\server.py", line 88, in setup_logger logger.info(f"📝 日志级别: {'DEBUG' if debug_mode else 'INFO'}") Message: '📝 日志级别: INFO' Arguments: () 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - 📝 日志级别: INFO 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - 📁 日志文件: web_server.log 2025-08-12 03:55:11,457 - WebServer - INFO - 📁 日志文件: web_server.log --- Logging error --- Traceback (most recent call last): File "E:\Python310\lib\logging\__init__.py", line 1103, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f4c1' in position 45: illegal multibyte sequence Call stack: File "E:\AI_System\web_ui\server.py", line 95, in <module> logger = setup_logger() File "E:\AI_System\web_ui\server.py", line 89, in setup_logger logger.info(f"📁 日志文件: {log_file}") Message: '📁 日志文件: web_server.log' Arguments: () 2025-08-12 03:55:11 - WebServer - INFO - 14196 - 5264 - 📁 日志文件: web_server.log Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 669, in <module> app, socketio = create_app() File "E:\AI_System\web_ui\server.py", line 643, in create_app system_initializer = SystemInitializer() File "E:\AI_System\web_ui\server.py", line 321, in __init__ logger.info(f"系统初始化器创建, 基础目录: {system_config.BASE_DIR}") File "E:\AI_System\core\config.py", line 188, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'CoreConfig' object has no attribute 'BASE_DIR' E:\AI_System\web_ui>

================================================ AI系统正在启动 [周二 2025/08/12 5:12:17.35] ================================================ [1/3] 启动模型API服务... Traceback (most recent call last): File "E:\AI_System\model_server\api_server.py", line 26, in <module> from prometheus_client import make_wsgi_app, Counter, Gauge, Histogram ModuleNotFoundError: No module named 'prometheus_client' [2/3] 启动AI核心服务... Traceback (most recent call last): File "E:\AI_System\agent\agent_core.py", line 24, in <module> from agent.cognitive_architecture import CognitiveArchitecture File "E:\AI_System\agent\__init__.py", line 14, in <module> from .autonomous_agent import AutonomousAgent File "E:\AI_System\agent\autonomous_agent.py", line 21, in <module> from core.config import system_config File "E:\AI_System\core\__init__.py", line 5, in <module> from .config import CoreConfig ImportError: cannot import name 'CoreConfig' from 'core.config' (E:\AI_System\core\config.py) [3/3] 启动用户界面... 系统启动完成!自动打开监控页面... Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 49, in <module> from core.config import CoreConfig as SystemConfig File "E:\AI_System\core\__init__.py", line 5, in <module> from .config import CoreConfig ImportError: cannot import name 'CoreConfig' from 'core.config' (E:\AI_System\core\config.py) ================================================ 运行中进程: ================================================ 按任意键退出此窗口(服务将继续在后台运行)...

Microsoft Windows [版本 10.0.22631.2861] (c) Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd /d E:\AI_System\web_ui E:\AI_System\web_ui>python server.py ❌ 配置文件格式错误: E:\AI_System\config\hardware_config.json - Expecting value: line 1 column 1 (char 0) 2025-08-10 01:21:32,344 - ConfigLoader - INFO - ✅ 使用环境变量指定工作区: E:\AI_Workspace 2025-08-10 01:21:32,345 - ConfigLoader - WARNING - ⚠️ 未找到环境文件: E:\AI_Workspace\.env - 使用默认配置 2025-08-10 01:21:32,345 - ConfigLoader - WARNING - ⚠️ 未找到硬件配置文件: E:\AI_Workspace\config\hardware_config.json 2025-08-10 01:21:32,345 - ConfigLoader - INFO - ============================================================ 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🏠 工作区根目录: E:\AI_Workspace 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🌿 环境: development (DEBUG: True) 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🌐 主机: 0.0.0.0:8000 (Gradio: 7860) 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 📝 日志级别: INFO 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 💾 模型缓存: E:\ai_temp\models 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🤖 默认模型: minimal-model (GPU: False) 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🔑 安全密钥: ***** 2025-08-10 01:21:32,345 - ConfigLoader - INFO - ⏰ 生活系统: 启用 2025-08-10 01:21:32,345 - ConfigLoader - INFO - 🗄️ 数据库: sqlite://ai_user@localhost:3306/ai_system 2025-08-10 01:21:32,345 - ConfigLoader - INFO - ============================================================ Traceback (most recent call last): File "E:\AI_System\web_ui\server.py", line 19, in <module> from cognitive_arch.life_scheduler import LifeScheduler File "E:\AI_System\cognitive_arch\__init__.py", line 3, in <module> from .decision_system import DecisionSystem ModuleNotFoundError: No module named 'cognitive_arch.decision_system' E:\AI_System\web_ui>

zip
JFM7VX690T型SRAM型现场可编程门阵列技术手册主要介绍的是上海复旦微电子集团股份有限公司(简称复旦微电子)生产的高性能FPGA产品JFM7VX690T。该产品属于JFM7系列,具有现场可编程特性,集成了功能强大且可以灵活配置组合的可编程资源,适用于实现多种功能,如输入输出接口、通用数字逻辑、存储器、数字信号处理和时钟管理等。JFM7VX690T型FPGA适用于复杂、高速的数字逻辑电路,广泛应用于通讯、信息处理、工业控制、数据中心、仪表测量、医疗仪器、人工智能、自动驾驶等领域。 产品特点包括: 1. 可配置逻辑资源(CLB),使用LUT6结构。 2. 包含CLB模块,可用于实现常规数字逻辑和分布式RAM。 3. 含有I/O、BlockRAM、DSP、MMCM、GTH等可编程模块。 4. 提供不同的封装规格和工作温度范围的产品,便于满足不同的使用环境。 JFM7VX690T产品系列中,有多种型号可供选择。例如: - JFM7VX690T80采用FCBGA1927封装,尺寸为45x45mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T80-AS同样采用FCBGA1927封装,但工作温度范围更广,为-55°C到+125°C,同样使用锡银焊球。 - JFM7VX690T80-N采用FCBGA1927封装和铅锡焊球,工作温度范围与JFM7VX690T80-AS相同。 - JFM7VX690T36的封装规格为FCBGA1761,尺寸为42.5x42.5mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T36-AS使用锡银焊球,工作温度范围为-55°C到+125°C。 - JFM7VX690T36-N使用铅锡焊球,工作温度范围与JFM7VX690T36-AS相同。 技术手册中还包含了一系列详细的技术参数,包括极限参数、推荐工作条件、电特性参数、ESD等级、MSL等级、重量等。在产品参数章节中,还特别强调了封装类型,包括外形图和尺寸、引出端定义等。引出端定义是指对FPGA芯片上的各个引脚的功能和接线规则进行说明,这对于FPGA的正确应用和电路设计至关重要。 应用指南章节涉及了FPGA在不同应用场景下的推荐使用方法。其中差异说明部分可能涉及产品之间的性能差异;关键性能对比可能包括功耗与速度对比、上电浪涌电流测试情况说明、GTH Channel Loss性能差异说明、GTH电源性能差异说明等。此外,手册可能还提供了其他推荐应用方案,例如不使用的BANK接法推荐、CCLK信号PCB布线推荐、JTAG级联PCB布线推荐、系统工作的复位方案推荐等,这些内容对于提高系统性能和稳定性有着重要作用。 焊接及注意事项章节则针对产品的焊接过程提供了指导,强调焊接过程中的注意事项,以确保产品在组装过程中的稳定性和可靠性。手册还明确指出,未经复旦微电子的许可,不得翻印或者复制全部或部分本资料的内容,且不承担采购方选择与使用本文描述的产品和服务的责任。 上海复旦微电子集团股份有限公司拥有相关的商标和知识产权。该公司在中国发布的技术手册,版权为上海复旦微电子集团股份有限公司所有,未经许可不得进行复制或传播。 技术手册提供了上海复旦微电子集团股份有限公司销售及服务网点的信息,方便用户在需要时能够联系到相应的服务机构,获取最新信息和必要的支持。同时,用户可以访问复旦微电子的官方网站(***以获取更多产品信息和公司动态。

大家在看

recommend-type

Xilinx ISE rs_decoder_ipcore and encoder License

Xilinx ISE RS编码解码IP核的License
recommend-type

毕业设计&课设-一个基于Matlab的PET仿真和重建框架,具有系统矩阵的分析建模,能够结合各种数据….zip

matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随
recommend-type

MATLAB机械臂简单控制仿真(Simulink篇-总).zip

MATLAB下机器人可视化与控制---simulink篇中的简单例子,在Simulink中做了预定义轨迹的运动和Slider Gain控制的运动,用GUI控制的关节代码在MATLAB下机器人可视化与控制
recommend-type

使用 GCC 构建 STM23F0 ARM 项目的模板源码

使用 GCC 构建 STM23F0 ARM 项目的模板源码,具体请看 README
recommend-type

详细说明 VC++的MFC开发串口调试助手源代码,包括数据发送,接收,显示制式等29782183com

详细说明 VC++的MFC开发串口调试助手源代码,包括数据发送,接收,显示制式等29782183com

最新推荐

recommend-type

计算机网络学习中学员常见问题与改进方法

计算机网络学习中学员常见问题与改进方法+
recommend-type

基于高斯混合模型(GMM)和主成分分析(PCA)的疲劳语音识别.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
recommend-type

Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)

Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目),个人大四的毕业设计、经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)Java毕业设计基于SpringBoot+Vue开发的智慧农业系统源码+数据库(高分项目)Java毕业设计个人大四的毕业设计、经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。个人大四的毕业设计 收起
recommend-type

用bp神经网络预测油田产量

资源下载链接为: https://pan.quark.cn/s/82cb66f4d6b4 用bp神经网络预测油田产量(最新、最全版本!打开链接下载即可用!)
recommend-type

2_JFM7VX690T型SRAM型现场可编程门阵列技术手册.pdf

JFM7VX690T型SRAM型现场可编程门阵列技术手册主要介绍的是上海复旦微电子集团股份有限公司(简称复旦微电子)生产的高性能FPGA产品JFM7VX690T。该产品属于JFM7系列,具有现场可编程特性,集成了功能强大且可以灵活配置组合的可编程资源,适用于实现多种功能,如输入输出接口、通用数字逻辑、存储器、数字信号处理和时钟管理等。JFM7VX690T型FPGA适用于复杂、高速的数字逻辑电路,广泛应用于通讯、信息处理、工业控制、数据中心、仪表测量、医疗仪器、人工智能、自动驾驶等领域。 产品特点包括: 1. 可配置逻辑资源(CLB),使用LUT6结构。 2. 包含CLB模块,可用于实现常规数字逻辑和分布式RAM。 3. 含有I/O、BlockRAM、DSP、MMCM、GTH等可编程模块。 4. 提供不同的封装规格和工作温度范围的产品,便于满足不同的使用环境。 JFM7VX690T产品系列中,有多种型号可供选择。例如: - JFM7VX690T80采用FCBGA1927封装,尺寸为45x45mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T80-AS同样采用FCBGA1927封装,但工作温度范围更广,为-55°C到+125°C,同样使用锡银焊球。 - JFM7VX690T80-N采用FCBGA1927封装和铅锡焊球,工作温度范围与JFM7VX690T80-AS相同。 - JFM7VX690T36的封装规格为FCBGA1761,尺寸为42.5x42.5mm,使用锡银焊球,工作温度范围为-40°C到+100°C。 - JFM7VX690T36-AS使用锡银焊球,工作温度范围为-55°C到+125°C。 - JFM7VX690T36-N使用铅锡焊球,工作温度范围与JFM7VX690T36-AS相同。 技术手册中还包含了一系列详细的技术参数,包括极限参数、推荐工作条件、电特性参数、ESD等级、MSL等级、重量等。在产品参数章节中,还特别强调了封装类型,包括外形图和尺寸、引出端定义等。引出端定义是指对FPGA芯片上的各个引脚的功能和接线规则进行说明,这对于FPGA的正确应用和电路设计至关重要。 应用指南章节涉及了FPGA在不同应用场景下的推荐使用方法。其中差异说明部分可能涉及产品之间的性能差异;关键性能对比可能包括功耗与速度对比、上电浪涌电流测试情况说明、GTH Channel Loss性能差异说明、GTH电源性能差异说明等。此外,手册可能还提供了其他推荐应用方案,例如不使用的BANK接法推荐、CCLK信号PCB布线推荐、JTAG级联PCB布线推荐、系统工作的复位方案推荐等,这些内容对于提高系统性能和稳定性有着重要作用。 焊接及注意事项章节则针对产品的焊接过程提供了指导,强调焊接过程中的注意事项,以确保产品在组装过程中的稳定性和可靠性。手册还明确指出,未经复旦微电子的许可,不得翻印或者复制全部或部分本资料的内容,且不承担采购方选择与使用本文描述的产品和服务的责任。 上海复旦微电子集团股份有限公司拥有相关的商标和知识产权。该公司在中国发布的技术手册,版权为上海复旦微电子集团股份有限公司所有,未经许可不得进行复制或传播。 技术手册提供了上海复旦微电子集团股份有限公司销售及服务网点的信息,方便用户在需要时能够联系到相应的服务机构,获取最新信息和必要的支持。同时,用户可以访问复旦微电子的官方网站(***以获取更多产品信息和公司动态。
recommend-type

美国国际航空交通数据分析报告(1990-2020)

根据给定的信息,我们可以从中提取和分析以下知识点: 1. 数据集概述: 该数据集名为“U.S. International Air Traffic data(1990-2020)”,记录了美国与国际间航空客运和货运的详细统计信息。数据集涵盖的时间范围从1990年至2020年,这说明它包含了长达30年的时间序列数据,对于进行长期趋势分析非常有价值。 2. 数据来源及意义: 此数据来源于《美国国际航空客运和货运统计报告》,该报告是美国运输部(USDOT)所管理的T-100计划的一部分。T-100计划旨在收集和发布美国和国际航空公司在美国机场的出入境交通报告,这表明数据的权威性和可靠性较高,适用于政府、企业和学术研究等领域。 3. 数据内容及应用: 数据集包含两个主要的CSV文件,分别是“International_Report_Departures.csv”和“International_Report_Passengers.csv”。 a. International_Report_Departures.csv文件可能包含了以下内容: - 离港航班信息:记录了各航空公司的航班号、起飞和到达时间、起飞和到达机场的代码以及国际地区等信息。 - 航空公司信息:可能包括航空公司代码、名称以及所属国家等。 - 飞机机型信息:如飞机类型、座位容量等,这有助于分析不同机型的使用频率和趋势。 - 航线信息:包括航线的起始和目的国家及城市,对于研究航线网络和优化航班计划具有参考价值。 这些数据可以用于航空交通流量分析、机场运营效率评估、航空市场分析等。 b. International_Report_Passengers.csv文件可能包含了以下内容: - 航班乘客信息:可能包括乘客的国籍、年龄、性别等信息。 - 航班类型:如全客机、全货机或混合型航班,可以分析乘客运输和货物运输的比例。 - 乘客数量:记录了各航班或航线的乘客数量,对于分析航空市场容量和增长趋势很有帮助。 - 飞行里程信息:有助于了解国际间不同航线的长度和飞行距离,为票价设置和燃油成本分析提供数据支持。 这些数据可以用于航空客运市场分析、需求预测、收益管理等方面。 4. 数据分析和应用实例: - 航空流量分析:通过分析离港航班数据,可以观察到哪些航线最为繁忙,哪些机场的国际航空流量最大,这有助于航空公司调整航班时刻表和运力分配。 - 市场研究:乘客数据可以揭示不同国家和地区之间的人口流动趋势,帮助航空公司和政府机构了解国际旅行市场的需求变化。 - 飞机利用率:结合飞机机型和飞行频率信息,可以对特定机型的使用率进行分析,评估飞机维护需求和燃油效率。 - 安全监管:通过对比不同航空公司和航班的安全记录,监管机构可以更有效地评估航空公司的安全性能,并采取必要的监管措施。 5. 技术和方法论: 分析此类数据通常涉及数据清洗、数据整合、统计分析、时间序列分析、预测建模等数据科学方法。使用Excel、SQL、R、Python等工具进行数据处理和分析是常见的做法。例如,可以使用Python的Pandas库来清洗和准备数据,使用Matplotlib和Seaborn库来可视化数据,然后利用Scikit-learn或Statsmodels库来构建预测模型。 通过以上知识点的提取和分析,我们可以理解到“U.S. International Air Traffic data(1990-2020)-数据集”的重要性,它不仅记录了跨越30年的航空交通数据,还为各种分析和应用提供了详实的基础信息。对于航空业从业者、政策制定者、研究人员以及数据分析师来说,这是一个极具价值的数据资源。
recommend-type

统计学视角:深入理解最小二乘法的概率论基础

# 1. 最小二乘法的基本概念 最小二乘法(Least Squares Method, LSM)是统计学和数据分析中广泛使用的一种数学优化技术。其主要目的是通过最小化误差的平方和来寻找数据的最佳函数匹配。这种方法最早由高斯提出,但在工程、物理、经济和其他领域中有着广泛的应用。 在本章中,我们将首先了
recommend-type

vscode中使用Codeium

<think>好的,我需要回答用户如何在VSCode中使用Codeium插件的问题。首先,我需要回顾用户提供的引用内容,看看是否有相关信息。用户提供的引用[1]提到了Codeium Chat可以解释代码中的问题,引用[2]提到了在IDEA中的一些问题,可能对VSCode的安装有帮助。用户还提到了安装步骤、基本功能、常见问题等。 首先,我应该分步骤说明安装过程,包括在VSCode扩展商店搜索Codeium并安装。然后,登录部分可能需要用户访问仪表板获取API密钥,引用[2]中提到登录问题,可能需要提醒用户注意网络或权限设置。 接下来是基本功能,比如代码自动补全和Chat功能。引用[1]提到C
recommend-type

UniMoCo:统一框架下的多监督视觉学习方法

在详细解析“unimoco”这个概念之前,我们需要明确几个关键点。首先,“unimoco”代表的是一种视觉表示学习方法,它在机器学习尤其是深度学习领域中扮演着重要角色。其次,文章作者通过这篇论文介绍了UniMoCo的全称,即“Unsupervised, Semi-Supervised and Full-Supervised Visual Representation Learning”,其背后的含义是在于UniMoCo框架整合了无监督学习、半监督学习和全监督学习三种不同的学习策略。最后,该框架被官方用PyTorch库实现,并被提供给了研究者和开发者社区。 ### 1. 对比学习(Contrastive Learning) UniMoCo的概念根植于对比学习的思想,这是一种无监督学习的范式。对比学习的核心在于让模型学会区分不同的样本,通过将相似的样本拉近,将不相似的样本推远,从而学习到有效的数据表示。对比学习与传统的分类任务最大的不同在于不需要手动标注的标签来指导学习过程,取而代之的是从数据自身结构中挖掘信息。 ### 2. MoCo(Momentum Contrast) UniMoCo的实现基于MoCo框架,MoCo是一种基于队列(queue)的对比学习方法,它在训练过程中维持一个动态的队列,其中包含了成对的负样本。MoCo通过 Momentum Encoder(动量编码器)和一个队列来保持稳定和历史性的负样本信息,使得模型能够持续地进行对比学习,即使是在没有足够负样本的情况下。 ### 3. 无监督学习(Unsupervised Learning) 在无监督学习场景中,数据样本没有被标记任何类别或标签,算法需自行发现数据中的模式和结构。UniMoCo框架中,无监督学习的关键在于使用没有标签的数据进行训练,其目的是让模型学习到数据的基础特征表示,这对于那些标注资源稀缺的领域具有重要意义。 ### 4. 半监督学习(Semi-Supervised Learning) 半监督学习结合了无监督和有监督学习的优势,它使用少量的标注数据与大量的未标注数据进行训练。UniMoCo中实现半监督学习的方式,可能是通过将已标注的数据作为对比学习的一部分,以此来指导模型学习到更精准的特征表示。这对于那些拥有少量标注数据的场景尤为有用。 ### 5. 全监督学习(Full-Supervised Learning) 在全监督学习中,所有的训练样本都有相应的标签,这种学习方式的目的是让模型学习到映射关系,从输入到输出。在UniMoCo中,全监督学习用于训练阶段,让模型在有明确指示的学习目标下进行优化,学习到的任务相关的特征表示。这通常用于有充足标注数据的场景,比如图像分类任务。 ### 6. PyTorch PyTorch是一个开源机器学习库,由Facebook的人工智能研究团队开发,主要用于计算机视觉和自然语言处理等任务。它被广泛用于研究和生产环境,并且因其易用性、灵活性和动态计算图等特性受到研究人员的青睐。UniMoCo官方实现选择PyTorch作为开发平台,说明了其对科研社区的支持和对易于实现的重视。 ### 7. 可视化表示学习(Visual Representation Learning) 可视化表示学习的目的是从原始视觉数据中提取特征,并将它们转换为能够反映重要信息且更易于处理的形式。在UniMoCo中,无论是无监督、半监督还是全监督学习,最终的目标都是让模型学习到有效的视觉表示,这些表示可以用于下游任务,如图像分类、目标检测、图像分割等。 ### 8. 标签队列(Label Queue) UniMoCo通过标签队列维护受监管的标签,这可能意味着对于那些半监督或全监督学习的任务,模型在进行对比学习时,会参考这些来自标签队列的数据。标签队列机制能帮助模型更好地利用有限的标注数据,增强模型的泛化能力。 ### 结论 UniMoCo的提出,以及其官方PyTorch实现的发布,将对计算机视觉领域产生深远影响。它不仅提供了一个统一的对比学习框架,使得从无监督到全监督的学习过程更加灵活和高效,而且为研究者们提供了一个强力的工具,以便更好地探索和实现各种视觉任务。UniMoCo的研究和应用前景,为机器学习尤其是深度学习在视觉领域的研究和实践提供了新的视角和可能。
recommend-type

【MATLAB算法精讲】:最小二乘法的实现与案例深度分析

# 1. 最小二乘法的基本原理 最小二乘法是一种数学优化技术,它通过最小化误差的平方和来寻找数据的最佳函数匹配。其核心思想是选择一条曲线,使得所有观察点到这条曲线的距离之和最小。这种方法广泛应用于统计学、信号处理、工程学和经济学等领域,尤其适用于需要通过一组数据点来确定函数参数的情况。 ## 1.1 统计学视角下的最小二乘法 在统计学中,最小二乘法经常用于