• [技术干货] 华为布道师中国人民大学站ICT及华为云技术布道
    2024年11月22日,华为开发者布道师于人民大学站开展布道师华为ICT创新赛和编程赛技术案例分享技术布道案例分享,并在分享中对相关疑问分析解答。首先介绍了基于鸿蒙生态的低光照增强安全辅助驾驶系统:低光照增强安全辅助驾驶系统以华为云作为训练的平台,以MindSpore作为框架,通过整合红外相机与可见光相机的特征,利用特征互补模型在软件平台控制下进行数据处理。系统采用Hispark IPC通讯协议实现各设备间的通信,包括红外相机、可见光相机、深度相机以及车辆显示屏等,这些设备采集的数据会上传到华为云进行进一步的处理和存储。在华为云的平台上,智能决策单元和传感器单元协同工作,收集并分析环境信息,同时应用云端算力对算法模型进行部署以优化系统性能。系统还具备低光照工作能力,能够实时显示感知数据,并在必要时进行决策预警,确保驾驶安全。此外,系统还展示了与Harmony OS生态的兼容,如手表等设备的联动提醒,以及红外点阵投影等高级功能,为驾驶者提供全面的安全辅助。并介绍了技术方案所涉及的关键技术:(1)传感器标定与图像配准技术:应用传感器标定与图像配准技术,对传感器采集到的图像数据进行进一步的配准以及标定。其中,本技术包括了双目视觉系统、交通目标识别方法、深度迭代配准算法来实现图像标定以及配准。其中,双目视觉系统基于深度迭代的配准方法主要使用CNN进行特征的提取或者代替传统配准算法中相似性度量的计算函数。使用深度学习网络对输入的图像对进行特征提取与相似性测度,能够实现配准图像的生成与图像配准精度的判别。在实际检测中,大大降低了系统的计算时间,提高了图像配准以及标定的精度。(2)图像特征融合感知技术在图像处理过程中还应用到了图像特征融合感知技术。在对标定以及配准好的图像进行特征融合的过程中,项目团队通过Mindspore训练的AI神经运算专用芯片,运用多源数据融合感知技术与交通安全隐患的智能检测从而识别不同模型,实现多源数据的精确融合。最终,在这些技术的应用下,通过不同类型相机采集到的图像特征进行融合感知,在低光照等不同恶劣环境(3)辅助决策预警与风险评估技术在辅助决策以及预警层面应用HiSpark-WiFi-IoT套件为主的智能决策模块来进行实现。通过紧急避障系统中搭建的感知层、规划层、决策层实现安全隐患智能评定与决策预警的相关功能,为显示交互单元提供安全数据信息。在辅助决策预警与风险评估的功能中,终端显示给用户也是十分关键的。所以在显示与交互的单元中开发了搭载Harmony OS的显示终端、多频报警音响等显示报警装置,运行配套开发的鸿蒙APP,实时显示感知数据与决策预警判定结果,可以在低光照、雨雪雾霾等全天候全场景工况下辅助驾驶人员进行判断,提升驾驶安全性与可靠性。接着介绍了基于华为云的制造业咨询服务微调问答助手案例:构建了私有的工业中文知识库问答系统,旨在为用户提供自定义友好、离线可运行的全面解决方案。​我们的系统的亮点包括:多模态交互。支持文本输入、语音输入和文件上传等多种输入方式,实现了多模态交互。用户可以根据实际需求选择最方便的交互方式,提高了系统的灵活性和适用性。同时,多模态交互也考虑到了用户的个体差异,满足了不同用户的使用习惯和需求。多功能对话界面。对话界面不仅支持基本的文本对话,还提供了多会话管理、对话模式切换和语音输入等功能。用户可以方便地切换不同对话会话,选择不同对话模式,以及通过语音输入进行自然交互。这种多功能对话界面提升了用户体验,使得系统更易于使用和操作。权限管理与安全性。系统引入了权限管理功能,通过登录注册和权限认证,确保只有经过授权的用户才能访问和操作知识库。这一功能提高了系统的安全性,防止未经授权的访问和操作,保护敏感信息免受泄露和篡改。知识库管理。系统提供了完整的知识库管理功能,包括知识库创建、文件上传、向量数据库构建、文件检索等。用户可以方便地管理知识库中的信息,通过文件对话和知识库问答等方式进行信息检索,满足不同场景和需求。检索增强的大模型。系统整合了检索增强的大模型,包括文件对话、知识库问答、搜索引擎问答和自定义Agent问答等功能。通过这些功能,系统可以更全面、准确地回答用户的问题,提供更丰富的信息服务。同时,用户可以选择不同的检索方式,根据实际需求获取最合适的答案。基于华为云ModelArts、企业级华为云主机的详细解决方案如下所示:首先介绍使用智能问答助手连接企业知识库实时获取信息。在权限管理方面,智能问答助手上运行着基于用户认证机制,利用安全框架,对用户进行身份验证,确保只有授权用户才能访问知识库;使用加密协议上传用户信息到云端服务中;使用专用SDK与API能够方便地对用户权限进行控制与管理。在系统实现方面,我们使用了微服务架构通过streamlit-authenticator模块对用户进行身份验证;并将认证结果通过后端服务传输到前端界面进行展示;前端界面使用HTML、CSS和JavaScript技术,通过发送请求获得认证结果,使用WebSocket技术实时更新用户界面。其次,介绍整合多模态对话输入技术,实现了与用户的高效交互。它支持传统的文本输入方式,同时引入了先进的语音输入识别技术,能够准确捕捉并实时转换用户的语音指令为文字,以便进行后续处理。这一语音输入功能的实现,依托于Streamlit和Bokeh库,通过在用户界面上设置一个专门的按钮,用户点击后即可激活语音识别。系统内部,js_on_event事件监听器与webkitSpeechRecognition对象协同工作,确保语音识别的准确性和实时性。此外,Omniind还提供了多种对话模板供用户选择,以适应不同咨询场景的需求,从而提升企业咨询服务的质量和效率。最后说明问答助手在知识库构建方面,预先构建了一个事实对应的知识库,用于存储和组织信息。当用户提出问题时,系统会进行问题解析,然后通过知识检索在知识库中寻找相关信息,最终生成答案。在实现过程中,助手采用了知识库构建、问题解析、知识检索和答案生成等一系列步骤,避免推理跳跃问题,确保了回答的准确性和相关性。为了验证系统的有效性,进行了功能测试。测试中,基于自定义数据集创建了Digital Twin领域的知识库,并提出了一系列问题,观察系统是否能够正确检索知识库并给出相关答案。此外,系统还提供了一个用户界面,用户可以通过这个界面与知识库进行交互,提出问题并获取答案。这个界面设计直观,易于使用,使得用户能够方便地获取所需的信息。通过这种方式,Omniind智能问答助手不仅提高了信息检索的效率,也提升了用户获取知识的体验。本次项目展示是华为开发者布道师​首次对ICT实战技术案例及华为云企业级边云部署行业解决方案进行高校技术布道,希望后续能够带给大家更多具有行业价值和实践意义的布道案例 。欢迎大家加入华为开发者布道师的大家庭,成为优秀的华为云开发者!
  • StoryDiffusion漫画创作节活动分享-VOD/创意
    进入活动链接:https://pangu.huaweicloud.com/gallery/asset-detail.html?id=c1cf0774-59ce-44fc-a4a8-8fcf026d2fec1、切换规格为64GB的限时免费规格2、点击执行3、然后执行:4、继续执行5、切换python版本,这个很重要!!!!,6、安装和启动运行7、最后生成了一个链接:Running on public URL: https://0dfb450b322dd89a40.gradio.live8、点击该URL,就可以开始使用了角色:man  活动: play basketball,选择风格类型使用效果1,这个是“线条艺术”这个是“油画”效果这个是“日本动画”风格该模型部署起来很方便,模型很强大,伙伴们可以多多探索,多少挖掘
  • [技术干货] 基于ModelArts Notebook +开源框架Langchain+大模型ChatGLM构建知识库问答实践
    基于ModelArts Notebook +开源框架Langchain+大模型ChatGLM构建知识库问答实践准备工作:有华为云账号,且已实名认证名词解释:Notebook:Notebook是ModelArts提供的云化版开发环境,预置了AI算力资源。无需安装,开箱即用;使用方式支持在线基于JupyterLab使用,同时支持通过IDE远程登陆使用。LangChain是一个开源框架,允许从事人工智能的开发者将例如GPT-4的大语言模型与外部计算和数据来源结合起来。该框架目前以Python或JavaScript包的形式提供。LangChain的六大组成成分:Models模型、Indexs索引、Prompts提示词、Chains链、Memory记忆、Agents代理LangChain的优势,主要体现在三点:提供了统一的LLM的接口和使用快速将本地知识导入大语言模型使用将连续多任务的关键词进行存储,让大模型具有“记忆”1 准备运行环境1.1 创建Notebook开发环境环境登录链接https://console.huaweicloud.com/modelarts/?agencyId=b10b36fd124f436aae254da19a6d888d®ion=cn-north-4&locale=zh-cn#/dev-container/create。创建Notebook实例时,镜像、GPU资源、硬盘按照下图所示:1.2 登录Notebook开发环境回到Notebook创建页,等待第一步创建的Notebook状态为运行中,从右侧打开进入Notebook。选择Notebook kernel环境,选择Pytorch-1.8,点击进入。实例化一个Notebook开发环境,作为主程序入口,并重命名为langchain_main.ipynb。注意:至此,准备工作已完成,接下来开始基于本地知识库对话问答应用开发,本案例的代码文件包含service文件夹和主程序,其中service包含了全局配置、模型服务类、知识库构建类,文件结构如下:LangChainApplication/├── service/│ ├── __init__.py # 包的初始化脚本│ └── config.py # 定义了模型路径等配置项│ └── chatglm_service.py #模型服务类,定义加载和调用模型函数│ └── knowledge_service.py #知识库构建类,加载和分割本地文件、构建向量数据库└── langchain_main.ipynb # Notebook实例,主程序入口,定义langchain应用类2 Service目录类文件说明Service目录中的文件都可在附件中下载2.1 路径配置文件config.py主要定义了模型的存储路径和本地原始知识文件的存储路径:2.2 模型服务文件chatglm_service.py主要是定义了模型服务类,主要是负责在Langchain中加载ChatGLM3模型,主要实现以下三点1)继承langchain.llms.base.LLM类,新建自定义的类2)通过@property装饰器将_llm_type方法转为【只读属性】,即可以被类访问,而不需要实例的方法来访问(比如model._llm_type == ChatGLM3的结果为true)3)重写_call方法:加载自己的模型,并限制只输出结果 (ChatGLM3原输出不是直接str,langchain中要求模型返回必须是str的结果)2.3 知识库构建文件knowledge_service.py该文件主要定义了本地原始知识文件(比如txt文件)的加载和分割处理函数,并通过处理本地知识文件构建向量知识库,本案例用的向量数据库是FAISS。3 Langchain应用开发下面开始进入主程序中,直接在打开的Notebook中执行如下的步骤:3.1 上传service目录中的文件根目录下新建service目录,从附件中下载service目录的文件,并上传到创建的service目录下3.2 上传本地原始知识文件在根目录下新建docs目录,用于存放本地原始知识文件上传本地的知识文件(一个txt文件,一个markdown文件),用于后续转化到向量数据库,构建本地知识库,案例中使用到的文件可在附件中下载使用3.3 下载ChatGLM模型并解压在实例化的langchain_main.ipynb中执行以下代码下载大模型到本地,并解压import osimport moxing as moxwork_dir = '/home/ma-user/work'obs_path = 'obs://dtse-models/tar-models/chatglm3-6b.tar'ma_path = os.path.join(work_dir, 'chatglm3-6b.tar')mox.file.copy(obs_path, ma_path)mox.file.copy_parallel('obs://modelarts-labs-bj4-v2/course/ModelBox/frpc_linux_amd64', '/home/ma-user/work/frpc_linux_amd64')os.chdir(work_dir)!pwd!tar -xvf chatglm3-6b.tar代码执行方式如下,后续代码执行方式同理,不再赘述。3.4 下载NLP处理软件包下载nltk_data工具包,供后续构建知识库使用import osimport moxing as moxwork_dir = '/home/ma-user/work'obs_path = 'obs://dtse-models/tar-models/nltk_data.tar'ma_path = os.path.join(work_dir, 'nltk_data.tar')mox.file.copy(obs_path, ma_path)#解压数据压缩包os.chdir(work_dir)!pwd!tar -xvf nltk_data.tar3.5 下载Embedding模型并解压这里用的是text2vec-large-chinese模型,是常用的中文中将文本转化为向量的模型import osimport moxing as moxobs_path = 'obs://dtse-models/tar-models/text2vec-large-chinese.tar'ma_path = os.path.join(work_dir, 'text2vec-large-chinese.tar')mox.file.copy(obs_path, ma_path)os.chdir(work_dir)!pwd!tar -xvf text2vec-large-chinese.tar新建代码块,执行上述代码执行结果如下:3.6 安装Python3.10虚拟环境本案例需要Python3.10以上版本,所以需要安装Python3.10的虚拟环境,在Notebook中执行以下代码:!/home/ma-user/anaconda3/bin/conda create -n python-3.10.10 python=3.10.10 -y --override-channels --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main!/home/ma-user/anaconda3/envs/python-3.10.10/bin/pip install ipykernel将安装的Python3.10加到Notebook kernel中,执行如下代码import jsonimport osdata = {"display_name": "python-3.10.10","env": {"PATH": "/home/ma-user/anaconda3/envs/python-3.10.10/bin:/home/ma-user/anaconda3/envs/python-3.7.10/bin:/modelarts/authoring/notebook-conda/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ma-user/modelarts/ma-cli/bin:/home/ma-user/modelarts/ma-cli/bin:/home/ma-user/anaconda3/envs/PyTorch-1.8/bin"},"language": "python","argv": ["/home/ma-user/anaconda3/envs/python-3.10.10/bin/python","-m","ipykernel","-f","{connection_file}"]}if not os.path.exists("/home/ma-user/anaconda3/share/jupyter/kernels/python-3.10.10/"):os.mkdir("/home/ma-user/anaconda3/share/jupyter/kernels/python-3.10.10/")with open('/home/ma-user/anaconda3/share/jupyter/kernels/python-3.10.10/kernel.json', 'w') as f:json.dump(data, f, indent=4)创建完成后,稍等片刻,或刷新页面,点击右上角kernel选择python-3.10.103.7 安装依赖的py库在Notebook中执行如下代码,安装依赖的py库:!pip install transformers==4.30.2!pip install sentencepiece==0.1.99!pip install torch==1.11.0+cu102 torchvision==0.12.0+cu102 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu102!pip install markdown==3.4.3!pip install faiss-gpu==1.7.2!pip install langchain==0.0.329 -i https://pypi.tuna.tsinghua.edu.cn/simple!pip install nltk==3.8.1 -i https://pypi.tuna.tsinghua.edu.cn/simple!pip install unstructured==0.10.24 -i https://pypi.tuna.tsinghua.edu.cn/simple!pip install sentence-transformers==2.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple!pip install huggingface-hub==0.25.2 -i https://pypi.tuna.tsinghua.edu.cn/simple!pip install gradio==3.39 mdtex2html -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn!cp /home/ma-user/work/frpc_linux_amd64 /home/ma-user/anaconda3/envs/python-3.10.10/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2!chmod +x /home/ma-user/anaconda3/envs/python-3.10.10/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2执行结果如下:3.8 基于langchain链定义应用类为了实现基于本地知识库的对话问答,当前使用了langchain的链来实现,即langchain.chains。在langchain.chains中有很多已有的链,例如:ConversationChain(对话链)、RetrievalQA(检索型问答)、ConversationalRetrievalChain(对话式检索问答)本文使用的是RetrievalQA,它可以很方便的实现基于知识库的问答,具体实现如下:1)首先定义语言模型和本地知识库的加载2)然后通过RetrievalQA.from_llm函数构造链的实例knowledge_chain,并配置一些参数3)最后通过调用knowledge_chain即可在Notebook中执行以下代码:from langchain.chains import RetrievalQAfrom langchain.prompts.prompt import PromptTemplatefrom service.config import LangChainCFGfrom service.chatglm_service import ChatGLMServicefrom service.knowledge_service import KnowledgeServiceclass LangChainApplication(object):#初始化,加载ChatGLM3模型和本地知识库def __init__(self, config):self.config = configself.llm_service = ChatGLMService()self.llm_service.load_model(model_name_or_path=self.config.llm_model_path)self.knowledge_service = KnowledgeService(config)#获取大语言模型返回的答案(基于本地知识库查询)def get_knowledge_based_answer(self, query,history_len=5,temperature=0.1,top_p=0.9,top_k=4,chat_history=[]):#定义查询的提示模板格式:prompt_template = """基于以下已知信息,简洁和专业的来回答用户的问题。如果无法从中得到答案,请说 "根据已知信息无法回答该问题" 或 "没有提供足够的相关信息",不允许在答案中添加编造成分,答案请使用中文。已知内容:{context}问题:{question}"""prompt = PromptTemplate(template=prompt_template,input_variables=["context", "question"])self.llm_service.history = chat_history[-history_len:] if history_len > 0 else []self.llm_service.temperature = temperatureself.llm_service.top_p = top_p#利用预先存在的语言模型(llm)、检索器(retriever)、提示(prompt)来创建并初始化BaseRetrievalQA类的实例knowledge_chain = RetrievalQA.from_llm(llm=self.llm_service,#基于本地知识库构建一个检索器,并仅返回top_k的结果retriever=self.knowledge_service.knowledge_base.as_retriever(search_kwargs={"k": top_k}),prompt=prompt)#combine_documents_chain的作用是将查询返回的文档内容(page_content)合并到一起作为prompt中context的值#将combine_documents_chain的合并文档内容改为{page_content}(代码默认定义为:Context:\n{page_content}),以适配中文knowledge_chain.combine_documents_chain.document_prompt = PromptTemplate(input_variables=["page_content"], template="{page_content}")#返回结果中是否包含源文档knowledge_chain.return_source_documents = True#传入问题内容进行查询result = knowledge_chain({"query": query})return result#获取大语言模型返回的答案(未基于本地知识库查询)def get_llm_answer(self, query):result = self.llm_service._call(query)return result4 知识库问答应用验证4.1 初步验证知识库功能通过实例化应用,验证来自大模型和大模型结合本地知识库的回答。Notebook中执行以下代码:from service.config import LangChainCFG#大模型回答config = LangChainCFG()application = LangChainApplication(config)result = application.get_llm_answer('ModelBox是什么')print('\nresult of llm:\n')print(result)print('\n########################################\n')#大模型结合本地知识库回答application.knowledge_service.init_knowledge_base()result2 = application.get_knowledge_based_answer('ModelBox是什么')print('\n########################################\n')print('\nresult of knowledge base:\n')print(result2)回答结果:4.2 使用gradio界面化知识库问答应用4.2.1 直接使用大模型本身构建界面应用import gradio as gr#返回函数def generate_text(question):result = application.get_llm_answer(question)return result# 创建Gradio界面iface = gr.Interface(fn=generate_text,inputs="text",outputs="text",title="大模型应用演示",description="这是一个基于Chatglm的大模型应用演示。你可以在这里输入提示,模型将生成相应的文本。",)# 启动界面iface.launch(share=True)执行结果如下:4.2.2 使用本地知识库结合大模型构建界面应用import gradio as grdef generate_text(question):result = application.get_knowledge_based_answer(question)return result[‘result’]# 创建Gradio界面iface = gr.Interface(fn=generate_text,inputs="text",outputs="text",title="大模型应用演示",description="这是一个基于Chatglm的大模型应用演示。你可以在这里输入提示,模型将生成相应的文本。",)# 启动界面iface.launch(share=True)结合本地知识库问答,未在知识库的内容回答与已知信息无关:
  • [自动学习] 小白使用ModelArts自动学习数据预测作业失败
    京': 54.404998779296875}, {'北京': 98.37659454345703}, {'北京': 22.441604614257812}, {'北京': 13.820075988769531}, {'北京': 75.55050659179688}, {'北京': 37.93954086303711}, {'北京': 0.799207329750061}, {'北京': 0.6004503965377808}, {'北京': 56.60489273071289}, {'北京': 0.733060359954834}, {'北京': 77.74537658691406}, {'北京': 3.4891605377197266}, {'北京': 2.8281638622283936}, {'北京': 26.810197830200195}, {'北京': 0.5323107242584229}, {'北京': 38.176780700683594}, {'北京': 26.697921752929688}, {'北京': 20.731277465820312}, {'北京': 0.5432376861572266}, {'北京': 52.847862243652344}, {'北京': 0.6899890303611755}, {'北京': 24.74304962158203}, {'北京': 211.07986450195312}, {'北京': 12.5050048828125}, {'北京': 69.27243041992188}, {'北京': 49.39892578125}, {'北京': 96.31230163574219}, {'北京': 2.879349708557129}, {'北京': 14.818251609802246}, {'北京': 48.24755096435547}, {'北京': 88.44140625}, {'北京': 77.21214294433594}, {'北京': 33.8985595703125}, {'北京': 2.713430404663086}, {'北京': 55.441444396972656}, {'北京': 5.705019950866699}, {'北京': 2.575700044631958}, {'北京': 30.877647399902344}, {'北京': 20.190807342529297}, {'北京': 90.63595581054688}, {'北京': 9.555702209472656}, {'北京': 80.36564636230469}, {'北京': 57.48477554321289}, {'北京': 0.7910892367362976}, {'北京': 108.09083557128906}, {'北京': 64.48189544677734}, {'北京': 94.38001251220703}, {'北京': 3.8600497245788574}, {'北京': 83.1424560546875}, {'北京': 4.512250900268555}, {'北京': 0.8153164982795715}, {'北京': 9.496097564697266}, {'北京': 2.560265302658081}, {'北京': 91.60176086425781}, {'北京': 56.86316680908203}, {'北京': 57.42603302001953}, {'北京': 20.70584487915039}, {'北京': 0.26431483030319214}, {'北京': 14.38227653503418}, {'北京': 55.344696044921875}, {'北京': 115.08047485351562}, {'北京': 50.63236999511719}, {'北京': 61.16187286376953}, {'北京': 0.9703119993209839}, {'北京': 17.487672805786133}, {'北京': 121.69760131835938}, {'北京': 70.99729919433594}, {'北京': 0.6049472093582153}, {'北京': 91.83737182617188}, {'北京': 22.75838851928711}, {'北京': 0.9982677698135376}, {'北京': 37.63583755493164}, {'北京': 118.57618713378906}, {'北京': 1.2771470546722412}, {'北京': 2.7817773818969727}, {'北京': 50.43586730957031}, {'北京': 2.266648292541504}, {'北京': 14.408712387084961}, {'北京': 183.56082153320312}, {'北京': 7.278913497924805}, {'北京': 1.2611498832702637}, {'北京': 25.200069427490234}, {'北京': 86.44888305664062}, {'北京': 259.09686279296875}, {'北京': 78.61936950683594}, {'北京': 34.81468200683594}, {'北京': 4.327343463897705}, {'北京': 32.960201263427734}, {'北京': 0.8986504673957825}] Traceback (most recent call last): File "/home/ma-user/modelarts/user-job-dir/预测分析/startup.py", line 441, in <module> predict(args, test_data) File "/home/ma-user/modelarts/user-job-dir/预测分析/startup.py", line 417, in predict evaluations = predictor.evaluate(data) File "/home/ma-user/modelarts/user-job-dir/预测分析/autogluon/tabular/predictor/predictor.py", line 934, in evaluate return self.evaluate_predictions(y_true=data[self.label], y_pred=y_pred_proba, silent=silent, auxiliary_metrics=auxiliary_metrics, detailed_report=detailed_report) File "/home/ma-user/modelarts/user-job-dir/预测分析/autogluon/tabular/predictor/predictor.py", line 963, in evaluate_predictions auxiliary_metrics=auxiliary_metrics, detailed_report=detailed_report) File "/home/ma-user/modelarts/user-job-dir/预测分析/autogluon/tabular/learner/abstract_learner.py", line 489, in evaluate_predictions self._validate_class_labels(y_true) File "/home/ma-user/modelarts/user-job-dir/预测分析/autogluon/tabular/learner/abstract_learner.py", line 460, in _validate_class_labels raise ValueError(f'Labels cannot contain missing (nan) values. Found {null_count} missing label values.') ValueError: Labels cannot contain missing (nan) values. Found 411 missing label values.部分日志ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/bd/e4/741f20c9b767330e2605d4c71a775303cb6a9c72764b8802232fe6c7afad/blis-1.0.1.tar.gz#sha256=91739cd850ca8100dcddbd8ad66942cab20c9473cdea9a35b165b11d7b8d91e4 (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-x8rm8rjy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz (3.6 MB)       Installing build dependencies: started       Installing build dependencies: finished with status 'error'       ERROR: Command errored out with exit status 1:        command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-bfw69qk3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0'            cwd: None       Complete output (9 lines):       Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/       Collecting setuptools         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)       Collecting cython>=0.25         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c1/36/aba1e7f0d1a795d3d153853f57ce01af4e8fa20c17fd577f5da240a3f0a4/Cython-3.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)       ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz#sha256=9ea14649ff07457e4112c7b94605e4aeb4f2fd5a8bd57c296ff8fbd154966ede (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-bfw69qk3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.     ERROR: Could not find a version that satisfies the requirement blis<1.1.0,>=1.0.0     ERROR: No matching distribution found for blis<1.1.0,>=1.0.0     WARNING: You are using pip version 21.0.1; however, version 24.0 is available.     You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.     ----------------------------------------   WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/ea/60/b7d645d621a47d649975b53c13cdf3e66b456a24727ccd34794f1014f45c/thinc-8.3.1.tar.gz#sha256=44e747bbf93e981dfded7d432b68ef1ba75b28ef46fc51f185477970743b36e9 (from http://repo.myhuaweicloud.com/repository/pypi/simple/thinc/) (requires-python:>=3.6). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-fj1vs6z4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'murmurhash>=1.0.2,<1.1.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'blis>=1.0.0,<1.1.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"'' Check the logs for full command output.     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/15/0a/250f7fa34632616bb4fc37decbc46ed09243bade708968dc869d8a4c144b/thinc-8.3.0.tar.gz (193 kB)     Installing build dependencies: started     Installing build dependencies: finished with status 'error'     ERROR: Command errored out with exit status 1:      command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-e3wlvnhy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'murmurhash>=1.0.2,<1.1.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'blis>=1.0.0,<1.1.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"''          cwd: None     Complete output (69 lines):     Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/     Ignoring numpy: markers 'python_version >= "3.9"' don't match your environment     Collecting setuptools       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)     Collecting cython<3.0,>=0.25       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b1/ff/ba21c11664b25c45e95b6270600e9644a303fe943988077ad84d4d0b1bc7/Cython-0.29.37-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)     Collecting murmurhash<1.1.0,>=1.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/5b/71/01fc0866ce9015cc57c584922a0ecc842ec4ac704b442eff23779e6b9443/murmurhash-1.0.11.tar.gz (13 kB)       Installing build dependencies: started       Installing build dependencies: finished with status 'done'       Getting requirements to build wheel: started       Getting requirements to build wheel: finished with status 'done'       Installing backend dependencies: started       Installing backend dependencies: finished with status 'done'         Preparing wheel metadata: started         Preparing wheel metadata: finished with status 'done'     Collecting cymem<2.1.0,>=2.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/62/eac45989f3d3296133f292f3097cb4c1f9d3ad3e5a85e79bbd2c7f96278f/cymem-2.0.10.tar.gz (10 kB)       Installing build dependencies: started       Installing build dependencies: finished with status 'done'       Getting requirements to build wheel: started       Getting requirements to build wheel: finished with status 'done'       Installing backend dependencies: started       Installing backend dependencies: finished with status 'done'         Preparing wheel metadata: started         Preparing wheel metadata: finished with status 'done'     Collecting preshed<3.1.0,>=3.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/d6/3c/95cf48030c0b45378988cafffcfd6948b932aedfc7924d6559c2628a399c/preshed-3.0.9-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (151 kB)     Collecting blis<1.1.0,>=1.0.0       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/bd/e4/741f20c9b767330e2605d4c71a775303cb6a9c72764b8802232fe6c7afad/blis-1.0.1.tar.gz (3.6 MB)       Installing build dependencies: started       Installing build dependencies: finished with status 'error'       ERROR: Command errored out with exit status 1:        command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-xdc4rodi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0'            cwd: None       Complete output (9 lines):       Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/       Collecting setuptools         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)       Collecting cython>=0.25         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c1/36/aba1e7f0d1a795d3d153853f57ce01af4e8fa20c17fd577f5da240a3f0a4/Cython-3.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)       ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/bd/e4/741f20c9b767330e2605d4c71a775303cb6a9c72764b8802232fe6c7afad/blis-1.0.1.tar.gz#sha256=91739cd850ca8100dcddbd8ad66942cab20c9473cdea9a35b165b11d7b8d91e4 (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-xdc4rodi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz (3.6 MB)       Installing build dependencies: started       Installing build dependencies: finished with status 'error'       ERROR: Command errored out with exit status 1:        command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-tvmyr0g7/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0'            cwd: None       Complete output (9 lines):       Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/       Collecting setuptools         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)       Collecting cython>=0.25         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c1/36/aba1e7f0d1a795d3d153853f57ce01af4e8fa20c17fd577f5da240a3f0a4/Cython-3.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)       ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz#sha256=9ea14649ff07457e4112c7b94605e4aeb4f2fd5a8bd57c296ff8fbd154966ede (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-tvmyr0g7/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.     ERROR: Could not find a version that satisfies the requirement blis<1.1.0,>=1.0.0     ERROR: No matching distribution found for blis<1.1.0,>=1.0.0     WARNING: You are using pip version 21.0.1; however, version 24.0 is available.     You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.     ----------------------------------------   WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/15/0a/250f7fa34632616bb4fc37decbc46ed09243bade708968dc869d8a4c144b/thinc-8.3.0.tar.gz#sha256=eb3bed54f5c00ec9addaaa208c51ccfa059483d73140cd515aa33373715c6e59 (from http://repo.myhuaweicloud.com/repository/pypi/simple/thinc/) (requires-python:>=3.6). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-e3wlvnhy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'murmurhash>=1.0.2,<1.1.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'blis>=1.0.0,<1.1.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"'' Check the logs for full command output.   ERROR: Could not find a version that satisfies the requirement thinc<8.4.0,>=8.3.0   ERROR: No matching distribution found for thinc<8.4.0,>=8.3.0   WARNING: You are using pip version 21.0.1; however, version 24.0 is available.   You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.   ---------------------------------------- WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/07/53/536941af8fbb5cb10a778f0dbd2a17b0f13e7ebfc11e67b154be60508fdf/spacy-3.8.2.tar.gz#sha256=4b37ebd25ada4059b0dc9e0893e70dde5df83485329a068ef04580e70892a65d (from http://repo.myhuaweicloud.com/repository/pypi/simple/spacy/) (requires-python:>=3.7). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-dhvx2164/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=8.3.0,<8.4.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"'' Check the logs for full command output.   Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/20/31865b2f773d10c82033cdde6bdaf28b0217897db6d6e2936887e36f17a3/spacy-3.8.0.tar.gz (1.3 MB)   Installing build dependencies: started   Installing build dependencies: still running...   Installing build dependencies: finished with status 'error'   ERROR: Command errored out with exit status 1:    command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ga30gtg3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=8.3.0,<8.4.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"''        cwd: None   Complete output (267 lines):   Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/   Ignoring numpy: markers 'python_version >= "3.9"' don't match your environment   Collecting setuptools     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)   Collecting cython<3.0,>=0.25     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b1/ff/ba21c11664b25c45e95b6270600e9644a303fe943988077ad84d4d0b1bc7/Cython-0.29.37-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)   Collecting cymem<2.1.0,>=2.0.2     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/62/eac45989f3d3296133f292f3097cb4c1f9d3ad3e5a85e79bbd2c7f96278f/cymem-2.0.10.tar.gz (10 kB)     Installing build dependencies: started     Installing build dependencies: finished with status 'done'     Getting requirements to build wheel: started     Getting requirements to build wheel: finished with status 'done'     Installing backend dependencies: started     Installing backend dependencies: finished with status 'done'       Preparing wheel metadata: started       Preparing wheel metadata: finished with status 'done'   Collecting preshed<3.1.0,>=3.0.2     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/d6/3c/95cf48030c0b45378988cafffcfd6948b932aedfc7924d6559c2628a399c/preshed-3.0.9-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (151 kB)   Collecting murmurhash<1.1.0,>=0.28.0     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/5b/71/01fc0866ce9015cc57c584922a0ecc842ec4ac704b442eff23779e6b9443/murmurhash-1.0.11.tar.gz (13 kB)     Installing build dependencies: started     Installing build dependencies: finished with status 'done'     Getting requirements to build wheel: started     Getting requirements to build wheel: finished with status 'done'     Installing backend dependencies: started     Installing backend dependencies: finished with status 'done'       Preparing wheel metadata: started       Preparing wheel metadata: finished with status 'done'   Collecting thinc<8.4.0,>=8.3.0     Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/8a/9f/b2193b69dd112a46800182e897cda2fc9c497dfdd9352a0c5ba9252cf5f0/thinc-8.3.2.tar.gz (193 kB)     Installing build dependencies: started     Installing build dependencies: finished with status 'error'     ERROR: Command errored out with exit status 1:      command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-osknhmvo/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25,<3.0' 'murmurhash>=1.0.2,<1.1.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'blis>=1.0.0,<1.1.0' 'numpy>=2.0.0,<2.1.0; python_version < '"'"'3.9'"'"'' 'numpy>=2.0.0,<2.1.0; python_version >= '"'"'3.9'"'"''          cwd: None     Complete output (69 lines):     Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/     Ignoring numpy: markers 'python_version >= "3.9"' don't match your environment     Collecting setuptools       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)     Collecting cython<3.0,>=0.25       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b1/ff/ba21c11664b25c45e95b6270600e9644a303fe943988077ad84d4d0b1bc7/Cython-0.29.37-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)     Collecting murmurhash<1.1.0,>=1.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/5b/71/01fc0866ce9015cc57c584922a0ecc842ec4ac704b442eff23779e6b9443/murmurhash-1.0.11.tar.gz (13 kB)       Installing build dependencies: started       Installing build dependencies: finished with status 'done'       Getting requirements to build wheel: started       Getting requirements to build wheel: finished with status 'done'       Installing backend dependencies: started       Installing backend dependencies: finished with status 'done'         Preparing wheel metadata: started         Preparing wheel metadata: finished with status 'done'     Collecting cymem<2.1.0,>=2.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/62/eac45989f3d3296133f292f3097cb4c1f9d3ad3e5a85e79bbd2c7f96278f/cymem-2.0.10.tar.gz (10 kB)       Installing build dependencies: started       Installing build dependencies: finished with status 'done'       Getting requirements to build wheel: started       Getting requirements to build wheel: finished with status 'done'       Installing backend dependencies: started       Installing backend dependencies: finished with status 'done'         Preparing wheel metadata: started         Preparing wheel metadata: finished with status 'done'     Collecting preshed<3.1.0,>=3.0.2       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/d6/3c/95cf48030c0b45378988cafffcfd6948b932aedfc7924d6559c2628a399c/preshed-3.0.9-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (151 kB)     Collecting blis<1.1.0,>=1.0.0       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/bd/e4/741f20c9b767330e2605d4c71a775303cb6a9c72764b8802232fe6c7afad/blis-1.0.1.tar.gz (3.6 MB)       Installing build dependencies: started       Installing build dependencies: finished with status 'error'       ERROR: Command errored out with exit status 1:        command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-krq5nk3l/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0'            cwd: None       Complete output (9 lines):       Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/       Collecting setuptools         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)       Collecting cython>=0.25         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c1/36/aba1e7f0d1a795d3d153853f57ce01af4e8fa20c17fd577f5da240a3f0a4/Cython-3.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)       ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/bd/e4/741f20c9b767330e2605d4c71a775303cb6a9c72764b8802232fe6c7afad/blis-1.0.1.tar.gz#sha256=91739cd850ca8100dcddbd8ad66942cab20c9473cdea9a35b165b11d7b8d91e4 (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-krq5nk3l/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.       Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz (3.6 MB)       Installing build dependencies: started       Installing build dependencies: finished with status 'error'       ERROR: Command errored out with exit status 1:        command: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-s9ws7f1o/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0'            cwd: None       Complete output (9 lines):       Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple/       Collecting setuptools         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl (804 kB)       Collecting cython>=0.25         Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c1/36/aba1e7f0d1a795d3d153853f57ce01af4e8fa20c17fd577f5da240a3f0a4/Cython-3.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)       ERROR: Could not find a version that satisfies the requirement numpy<3.0.0,>=2.0.0       ERROR: No matching distribution found for numpy<3.0.0,>=2.0.0       WARNING: You are using pip version 21.0.1; however, version 24.0 is available.       You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command.       ----------------------------------------     WARNING: Discarding http://repo.myhuaweicloud.com/repository/pypi/packages/b6/0b/a73be025d991e8795626a830314984f7bda5de440e80b72a53bc316bb870/blis-1.0.0.tar.gz#sha256=9ea14649ff07457e4112c7b94605e4aeb4f2fd5a8bd57c296ff8fbd154966ede (from http://repo.myhuaweicloud.com/repository/pypi/simple/blis/). Command errored out with exit status 1: /home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-s9ws7f1o/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://repo.myhuaweicloud.com/repository/pypi/simple/ --trusted-host repo.myhuaweicloud.com -- setuptools 'cython>=0.25' 'numpy>=2.0.0,<3.0.0' Check the logs for full command output.     ERROR: Could not find a version that satisfies the requirement blis<1.1.0,>=1.0.0     ERROR: No matching distribution found for blis<1.1.0,>=1.0.0     WARNING: You are using pip version 21.0.1; however, version 24.0 is available.     You should consider upgrading via the '/home/ma-user/anaconda3/envs/PyTorch-1.8/bin/python -m pip install --upgrade pip' command. 
  • [部署上线] 有没有本地验证模型部署文件可行性的方法
    云端部署本地模型需要提供customize_service.py config.json 和模型文件,有没有能够离线验证这套文件能否正确部署模型并预测的工具呢每次上传再部署文件感觉好麻烦我主要是在调试customize_service.py文件
  • StoryDiffusion漫画创作节活动分享-VOD/创意
    跟着步骤走,也算是挺简单的,就是huggingface拉取model镜像会有网络问题,不清楚是不是只有我一人遇到。​
  • [问题求助] 使用 PyCharm ToolKit 创建并调试训练作业
    使用 PyCharm ToolKit 创建并调试训练作业时,出现图片中的错误,谁知问题出在哪了呀,运行自动上传到OBS文件中的代码文件时zip格式,和这个有关吗?
  • [部署上线] 模型部署的前后处理文件该怎么写
    目标:上传本地模型,通过桶创建AI应用并部署在线服务,并成功实现在线手势图片预测背景介绍:利用ultralytics库的yolov8n.pt模型训练了一个手势识别的模型,由于云端环境不兼容,ultralytics的YOLO库无法正常使用,所以我把模型转化为了.pth格式的pytorch模型问题描述:在执行在线服务的预测阶段,模型无法正常预测,我猜测问题出现在customize_service.py的_postprocess方法不正确最近一次测试的报错日志:start. . .2024-12-02 15:17:05 CST [MainThread ] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py[line:111] - INFO: Namespace(model_name='serve', model_path='/home/ma-user/infer/model/1/best.pth', pt_server_name='127.0.0.1', service_file='/home/ma-user/infer/model/1/customize_service.py') []2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py[line:63] - INFO: preprocess time: 67.35610961914062ms [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py[line:63] - INFO: preprocess time: 67.35610961914062ms [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py[line:69] - INFO: infer time: 143.97621154785156ms [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py[line:69] - INFO: infer time: 143.97621154785156ms [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py[line:86] - ERROR: Algorithm crashed! [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py[line:86] - ERROR: Algorithm crashed! [4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py[line:87] - ERROR: Traceback (most recent call last):File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py", line 83, in predictres = model_service.inference(rec_dict)File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py", line 70, in inferencedata = self._postprocess(data)File "/home/ma-user/infer/model/1/customize_service.py", line 70, in _postprocesstar = np.array(data[0])KeyError: 0[4743ed1de3ca493b82adaede25f6bd63]2024-12-02 15:17:54 CST [ThreadPoolEx] - /home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py[line:87] - ERROR: Traceback (most recent call last):File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/app.py", line 83, in predictres = model_service.inference(rec_dict)File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/model_service/model_service.py", line 70, in inferencedata = self._postprocess(data)File "/home/ma-user/infer/model/1/customize_service.py", line 70, in _postprocesstar = np.array(data[0])KeyError: 0[4743ed1de3ca493b82adaede25f6bd63]我在本地写了一个测试import osimport randomimport torchfrom torchvision import transformsimport osimport numpy as npfrom PIL import Imagedef preprocess(data):preprocessed_data = {}for k, v in data.items():for file_name, file_content in v.items():# 使用PIL读取图像image_tar = Image.open(file_content).convert('RGB')# 定义预处理变换preprocess = transforms.Compose([transforms.Resize((512, 512)),transforms.ToTensor(),])# 应用预处理变换image_tar = preprocess(image_tar)# 添加batch维度image_tar = image_tar.unsqueeze(0)# 将处理后的图像数据存储到preprocessed_data中preprocessed_data[k] = image_tarreturn preprocessed_datadef postprocess(data):tar = np.array(data[0][0]) # 获取15 * 5376的数据cfd_board = 0.5 # 置信度阈值boxes, class_probs = tar[:4, :], tar[4:, :] # 前4个值为边界框坐标,后11个值为类别概率# 初始化输出列表box_tar = []class_tar = []# 遍历每个边界框for i in range(boxes.shape[1]):box = boxes[:, i]class_prob = class_probs[:, i]# 计算最大类别概率及其索引max_class_prob = np.max(class_prob)max_class_idx = np.argmax(class_prob)# 如果最大类别概率大于置信度阈值,则保留该边界框if max_class_prob > cfd_board:box_tar.append(box)class_tar.append(max_class_idx)output = [box_tar, class_tar]return outputif __name__ == '__main__':# 加载模型model_path = 'resnet/model/best.pth'model = torch.load(model_path)model.eval() # 设置模型为评估模式# 设置测试路径tar_path = 'test'tars = os.listdir(tar_path)# 随机选择一个测试图像tar = random.choice(tars)test_tar = tar# 预处理preprocessed_data = preprocess({'data': {test_tar: os.path.join(tar_path, test_tar)}})model_output = model(list(preprocessed_data.values())[0])# 后处理final_output = postprocess(model_output)这样是能正确读取预测数据的,但是云端部署的脚本我不太明白应该怎么写,目前在预测阶段会报错config.json{"model_algorithm": "image_classification","model_type": "PyTorch","runtime": "pytorch_1.8.0-cuda_10.2-py_3.7-ubuntu_18.04-x86_64","apis":[{"url": "/","method": "post","request":{"Content-type": "multipart/form-data","data":{"type": "object","properties":{"images":{"type": "file"}}}},"response":{"Content-type": "applicaton/json","data":{"type": "object","properties": {"detection_classes":{"type": "array","items":[{"type": "string"}]},"detection_boxes":{"type": "array","items":[{"type": "array","minItems": 4,"maxItems": 4,"items":[{"type": "number"}]}]},"detection_scores":{"type": "array","items":[{"type": "number"}]}}}}}],"dependencies":[{"installer": "pip","packages":[{"package_name": "ultralytics"}]}]}customize_service.py(主要问题都在这个文件的_postprocess方法)import torchfrom torchvision import transformsfrom model_service.pytorch_model_service import PTServingBaseServiceimport loggingimport osimport jsonimport numpy as npfrom PIL import Imageimport threadinglogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')logger = logging.getLogger(__name__)def ppc(data):tar = np.array(data[0]) # 获取15 * 5376的数据cfd_board = 0.5 # 置信度阈值boxes, class_probs = tar[:4, :], tar[4:, :] # 前4个值为边界框坐标,后11个值为类别概率# 初始化输出列表box_tar = []class_tar = []class_prob_tar = []# 遍历每个边界框for i in range(boxes.shape[1]):box = boxes[:, i]class_prob = class_probs[:, i]# 计算最大类别概率及其索引max_class_prob = np.max(class_prob)max_class_idx = np.argmax(class_prob)# 如果最大类别概率大于置信度阈值,则保留该边界框if max_class_prob > cfd_board:box_tar.append(box)class_tar.append(max_class_idx)class_prob_tar.append(max_class_prob)output = [box_tar, class_tar, class_prob_tar]return outputclass CustomInferenceService(PTServingBaseService):def __init__(self, model_name, model_path):super(CustomInferenceService, self).__init__(model_name, model_path)self.model_name = model_nameself.model_path = model_pathself.model_inputs = {}self.model_outputs = {}self.classes = ['unknown', 'dislike', 'like', 'OK', 'fist','victory', 'heart', 'palm', 'stop', '666', 'rock']# 初始化 label 属性self.label = self.classes# 非阻塞方式加载PyTorch模型,防止阻塞超时thread = threading.Thread(target=self.load_pytorch_model)thread.start()def load_pytorch_model(self):try:# 加载PyTorch模型self.model = torch.load(self.model_path)self.model.eval() # 设置模型为评估模式logger.info("PyTorch model loaded successfully")except Exception as e:logger.error(f"Failed to load PyTorch model: {e}")def _preprocess(self, data):logger.debug(f"Data received in postprocess: {data}")preprocessed_data = {}try:for k, v in data.items():for file_name, file_content in v.items():# 使用PIL读取图像image_tar = Image.open(file_content).convert('RGB')# 定义预处理变换preprocess = transforms.Compose([transforms.Resize((512, 512)),transforms.ToTensor(),transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),])# 应用预处理变换image_tar = preprocess(image_tar)# 添加batch维度image_tar = image_tar.unsqueeze(0)# 将处理后的图像数据存储到preprocessed_data中preprocessed_data[k] = image_tarexcept Exception as e:logger.error(f"Preprocessing failed: {e}")raisereturn preprocessed_data# 将推理的结果进行后处理,得到预期的输出格式,该结果就是最终的返回值def _postprocess(self, data):results = {}for k, v in data.items():ppc_data = ppc(v)detection_classes = ppc_data[1]detection_boxes = ppc_data[0]detection_scores = ppc_data[2]results[k] = {"detection_classes": detection_classes,"detection_boxes": detection_boxes,"detection_scores": detection_scores}return results# 对于输入数据进行前向推理,得到推理结果def _inference(self, data):result = {}for k, v in data.items():result[k] = self.model(v)return result数据描述:output = model(input)output[0]的形状:1 * 15 * 5376  (5376=64^2 + 32^2 + 16^2)output[1][0]的形状:1*75*64*64output[1][1]的形状:1*75*32*32output[1][2]的形状:1*75*16*16
  • [技术干货] ModelArts_AI开发平台之交通信号标志检测与识别
    【任务背景】近年来,随着人工智能和传感器技术的快速进步,自动驾驶汽车技术也取得了长足发展。从最初的辅助驾驶系统到如今可实现完全自主驾驶的汽车,自动驾驶技术正在改变我们的出行方式。其中,交通信号识别技术作为自动驾驶系统的核心功能之一,能够准确感知和识别道路上的各类交通标志、信号灯等,为车辆提供精准的行驶决策依据,确保行车安全性和效率。基于视觉的交通信号标志检测与识别任务旨在开发出精准高效的识别算法,助力自动驾驶汽车技术的进步。任务包含步行、非机动车行驶、环岛行驶、机动车行驶等多种交通信号标志类别,开发者会利用到计算机视觉领域的目标检测、关键点检测、图像分类等基础技术,为提升识别效率,也可以拓展使用剪枝、量化、蒸馏等模型方面的优化技术。ModelArts云平台提供任务相关的数据处理、模型训练、应用部署等技术文档及学习课程材料,助力开发者学习相关技术,了解实践操作。【数据说明】本次任务需要识别以下16种类别的交通标识,类别编号与定义如下表:i1i2i3i4Walk步行Non_motorized vehicles非机动车行驶Round the island 环岛行驶Motor vehicle 机动车行驶i5i6i7i8Keep on the right side of the road靠右侧道路行驶Keep on the left side of the road 靠左侧道路行驶Drive straight and turn right at the grade separation 立体交叉直行和右转弯行驶Drive straight and turn left 立体交叉直行和左转弯行驶i9i10i11i12Honk 鸣喇叭Turn right 向右转弯Turn left and right 向左向右转弯Turn left 向左转弯i13i14i15il50One way, straight 直行Go straight and turn right 直行和向右转弯Go straight and turn left 直行和向左转弯Minimum Speed Limit 最低限速50【任务说明】本任务的测试集为200张图片,这些图片为中国多个城市街景的高分辨率图像,每张图片包含1种交通信号标识。数据集图片示例检测结果以图片为单位输出其中包括交通信号标识的类别、坐标与置信度,每张图片输出一个结果,格式为json字符串,字段说明如下: { "detection_classes": ["i1"], "detection_boxes": [[576, 423, 669, 967]], "detection_scores": [0.4796633720397949] }• detection_classes:指图片中目标的类别,参见上面的数据说明。• detection_boxes:指图片中目标位置的水平矩形框坐标,坐标表示为[ymin,xmin,ymax,xmax]。• detection_scores:指检测结果的置信度。【案例教学】【准备数据集】# 步骤1:从OBS迁移数据集 import moxing as mox mox.file.copy_parallel("obs://trafficbuckets/dataset/update_traffic_sign.zip", "/home/ma-user/work/dataset/update_traffic_sign.zip") # 形参:源文件->指定位置# 步骤2:解压数据集并更改名称为update_traffic_sign import os os.system('unzip /home/ma-user/work/download/update_traffic_sign.zip -d /home/ma-user/work/dataset') os.system('mv /home/ma-user/work/dataset/"update traffic sign" /home/ma-user/work/dataset/update_traffic_sign')# 生成train和val图片名文本文件 from glob import glob import random # hyper parameter train_pic_rate = 0.7 # you can change! # 该目录存储图片数据 patch_fn_list = glob('/home/ma-user/work/dataset/update_traffic_sign/images/*.jpg') # you can change! # 返回存储图片名的列表,不包含图片的后缀 patch_fn_list = [fn for fn in patch_fn_list] # 将图片打乱顺序 random.shuffle(patch_fn_list) # 按照7:3比例划分train和val train_num = int(train_pic_rate * len(patch_fn_list)) train_patch_list = patch_fn_list[:train_num] valid_patch_list = patch_fn_list[train_num:] # produce train/valid/trainval txt file split = ['train', 'val', 'trainval'] # produce train/valid/trainval txt file split = ['train2017', 'val2017', 'trainval2017'] for s in split: # 存储文本文件的地址 save_path = '/home/ma-user/work/dataset/update_traffic_sign/' + s + '.txt' # you can change! if s == 'train2017': with open(save_path, 'w') as f: for fn in train_patch_list: # 将训练图像的地址写入train.txt文件 f.write('%s\n' % fn) elif s == 'val2017': with open(save_path, 'w') as f: for fn in valid_patch_list: # 将验证图像的地址写入val.txt文件 f.write('%s\n' % fn) elif s == 'trainval2017': with open(save_path, 'w') as f: for fn in patch_fn_list: # 将所有图像名的编号写入trainval.txt文件 f.write('%s\n' % fn) print('Finish Producing %s txt file to %s' % (s, save_path))# 按照train.txt和val.txt将images分类 import shutil import os def my_move(trainlistdir,vallistdir,traindir,valdir): # 打开train.txt文件 fopen = open(trainlistdir, 'r') # 读取图片名称 file_names = fopen.readlines() for file_name in file_names: file_name=file_name.strip('\n') # 图片的路径 traindata = file_name # 把图片复制至traindir路径下 # 如果目标文件夹不存在,则创建它 if not os.path.exists(traindir): os.makedirs(traindir) shutil.move(traindata, traindir) # 同上 fopen = open(vallistdir, 'r') file_names = fopen.readlines() for file_name in file_names: file_name=file_name.strip('\n') valdata = file_name # 如果目标文件夹不存在,则创建它 if not os.path.exists(valdir): os.makedirs(valdir) shutil.move(valdata, valdir) # 存储训练图片名的txt文件地址 trainlistdir=r'/home/ma-user/work/dataset/update_traffic_sign/train2017.txt' # 存储验证图片名的txt文件地址 vallistdir=r'/home/ma-user/work/dataset/update_traffic_sign/val2017.txt' # coco格式数据集的train2017目录 traindir=r'/home/ma-user/work/dataset/update_traffic_sign/images/train2017' # coco格式数据集的val2017目录 valdir=r'/home/ma-user/work/dataset/update_traffic_sign/images/val2017' my_move(trainlistdir,vallistdir,traindir,valdir)# 按照train.txt和val.txt将labels分类 import shutil import os def my_move(datadir, trainlistdir,vallistdir,traindir,valdir): # 打开train.txt文件 fopen = open(trainlistdir, 'r') # 读取图片名称 file_names = fopen.readlines() for file_name in file_names: file_name=file_name.strip('\n') # 图片的路径 tmp_list = file_name.split('/') tmp_list[-2] = 'labels' train_sp = os.path.join('/', *tmp_list) traindata = train_sp.split('.jpg')[-2] + '.txt' # 把图片复制至traindir路径下 # 如果目标文件夹不存在,则创建它 if not os.path.exists(traindir): os.makedirs(traindir) shutil.move(traindata, traindir) # 同上 fopen = open(vallistdir, 'r') file_names = fopen.readlines() for file_name in file_names: file_name=file_name.strip('\n') tmp_list_v = file_name.split('/') tmp_list_v[-2] = 'labels' val_sp = os.path.join('/', *tmp_list_v) valdata = val_sp.split('.jpg')[-2] + '.txt' # 如果目标文件夹不存在,则创建它 if not os.path.exists(valdir): os.makedirs(valdir) shutil.move(valdata, valdir) # labels存储地址 datadir=r'/home/ma-user/work/dataset/update_traffic_sign/labels/' # 存储训练图片名的txt文件地址 trainlistdir=r'/home/ma-user/work/dataset/update_traffic_sign/train2017.txt' # 存储验证图片名的txt文件地址 vallistdir=r'/home/ma-user/work/dataset/update_traffic_sign/val2017.txt' # coco格式数据集的train2017目录 traindir=r'/home/ma-user/work/dataset/update_traffic_sign/labels/train2017' # coco格式数据集的val2017目录 valdir=r'/home/ma-user/work/dataset/update_traffic_sign/labels/val2017' my_move(datadir, trainlistdir,vallistdir,traindir,valdir)# 对images和labels重命名 import os def rename_img_label(images_folder, labels_folder): # 获取文件夹中的文件列表 images = sorted(os.listdir(images_folder)) labels = sorted(os.listdir(labels_folder)) # 重新命名文件 for i, (image_file, label_file) in enumerate(zip(images, labels)): # 生成新的文件名 new_name = f"{i + 1:03d}" # 格式化为三位数 image_ext = os.path.splitext(image_file)[1] # 获取图片扩展名 label_ext = os.path.splitext(label_file)[1] # 获取标签扩展名 # 构建新的完整路径 new_image_path = os.path.join(images_folder, f"{new_name}{image_ext}") new_label_path = os.path.join(labels_folder, f"{new_name}{label_ext}") # 重命名文件 os.rename(os.path.join(images_folder, image_file), new_image_path) os.rename(os.path.join(labels_folder, label_file), new_label_path) print("文件重命名完成。") # 设置train文件夹路径 train_images_folder = '/home/ma-user/work/dataset/update_traffic_sign/images/train2017' train_labels_folder = '/home/ma-user/work/dataset/update_traffic_sign/labels/train2017' # 设置val文件夹路径 val_images_folder = '/home/ma-user/work/dataset/update_traffic_sign/images/val2017' val_labels_folder = '/home/ma-user/work/dataset/update_traffic_sign/labels/val2017' rename_img_label(train_images_folder, train_labels_folder) rename_img_label(val_images_folder, val_labels_folder)import os # 设置文件夹路径 folder_train = '/home/ma-user/work/dataset/update_traffic_sign/images/train2017' folder_val = '/home/ma-user/work/dataset/update_traffic_sign/images/val2017' output_file_train = '/home/ma-user/work/dataset/update_traffic_sign/train2017.txt' # 输出的 TXT 文件名 output_file_val = '/home/ma-user/work/dataset/update_traffic_sign/val2017.txt' # 输出的 TXT 文件名 def writetxt(floder_path, outputfilename): # 获取文件夹中的文件列表 file_names = os.listdir(floder_path) file_names.sort() # 将文件名写入 TXT 文件 with open(outputfilename, 'w') as f: for file_name in file_names: f.write(os.path.join(floder_path, file_name) + '\n') print(f"文件名已写入 {outputfilename}。") writetxt(folder_train, output_file_train) writetxt(folder_val, output_file_val)# 生成json文件(可选) import glob import json import os from PIL import Image def yolo_to_coco_for_subset(yolo_images_folder, yolo_labels_folder, categories): # Initialize COCO dataset structure for the subset coco_format = { "images": [], "annotations": [], "categories": [] } # Add category information for i, category in enumerate(categories): coco_format["categories"].append({ "id": i + 1, "name": category, "supercategory": "none" }) image_id = 0 annotation_id = 0 # image_id = -1 # annotation_id = -1 for image_file in glob.glob(f"{yolo_images_folder}/*.jpg"): print(image_file) # Read image to get width and height with Image.open(image_file) as img: width, height = img.size # Add image information with size coco_format["images"].append({ "id": image_id + 1, "file_name": os.path.basename(image_file), "width": width, "height": height }) # Corresponding annotation file yolo_annotation_file = os.path.join(yolo_labels_folder, os.path.basename(image_file).replace(".jpg", ".txt")) if os.path.exists(yolo_annotation_file): with open(yolo_annotation_file, "r") as file: for line in file: category_id, x_center, y_center, bbox_width, bbox_height = map(float, line.split()) # Convert YOLO format to COCO format x_min = (x_center - bbox_width / 2) * width y_min = (y_center - bbox_height / 2) * height coco_bbox_width = bbox_width * width coco_bbox_height = bbox_height * height # change image_id img_id = int(image_file.split('/')[-1].split('.')[-2]) print(img_id) # Add annotation information coco_format["annotations"].append({ "id": annotation_id + 1, "image_id": img_id, # image_id + 1, "category_id": int(category_id) + 1, "bbox": [x_min, y_min, coco_bbox_width, coco_bbox_height], "area": coco_bbox_width * coco_bbox_height, "segmentation": [], # Optional "iscrowd": 0 }) annotation_id += 1 image_id += 1 return coco_format def save_coco_format(coco_format, output_file): with open(output_file, "w") as file: json.dump(coco_format, file, indent=4) # Example usage yolo_base_folder = "/home/ma-user/work/dataset/update_traffic_sign/" # 父级文件夹 file_path = '/home/ma-user/work/dataset/update_traffic_sign/classes.txt' # 替换为你的txt文件路径 train_json_save_path = '/home/ma-user/work/dataset/update_traffic_sign/annotations/instances_train2017.json' # train json保存路径 val_json_save_path = '/home/ma-user/work/dataset/update_traffic_sign/annotations/instances_val2017.json' # val json保存路径 # 判断文件夹是否存在,若不存在则创建 # 判断文件夹是否存在,若不存在则创建 list_name_train = train_json_save_path.split('/')[:-1] if not os.path.exists(os.path.join(*list_name_train)): os.mkdir(os.path.join('/', *list_name_train)) # 读取txt文件并将每一行转换为列表 categories = [] with open(file_path, 'r') as file: lines = file.readlines() # 读取文件的所有行 for line in lines: categories.append(line.strip()) # 输出结果 print(categories) # Convert train set train_coco_format = yolo_to_coco_for_subset( os.path.join(yolo_base_folder, "images/train2017"), os.path.join(yolo_base_folder, "labels/train2017"), categories ) save_coco_format(train_coco_format, train_json_save_path) # Convert val set val_coco_format = yolo_to_coco_for_subset( os.path.join(yolo_base_folder, "images/val2017"), os.path.join(yolo_base_folder, "labels/val2017"), categories ) save_coco_format(val_coco_format, val_json_save_path)# 查看数据集 import os import random import cv2 import numpy as np from matplotlib import pyplot as plt %matplotlib inline # classes = ["open", "short","mousebite","spur","copper",'pin-hole'] # 类别 classes = ['i1', 'i10', 'i11', 'i12', 'i13', 'i14', 'i15', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9', 'i50'] file_path = "/home/ma-user/work/dataset/update_traffic_sign/images/train2017" file_list = os.listdir(file_path) img_paths = random.sample(file_list, 4) img_lists = [] for img_path in img_paths: img_path = os.path.join(file_path, img_path) img = cv2.imread(img_path) h, w, _ = img.shape tl = round(0.002 * (h + w) / 2) + 1 color = [random.randint(0, 255) for _ in range(3)] if img_path.endswith('.png'): with open(img_path.replace("images", "labels").replace(".png", ".txt")) as f: labels = f.readlines() if img_path.endswith('.jpg'): with open(img_path.replace("images", "labels").replace(".jpg", ".txt")) as f: labels = f.readlines() for label in labels: l, x, y, wc, hc = [float(x) for x in label.strip().split()] x1 = int((x - wc / 2) * w) y1 = int((y - hc / 2) * h) x2 = int((x + wc / 2) * w) y2 = int((y + hc / 2) * h) cv2.rectangle(img, (x1, y1), (x2, y2), color, thickness=tl, lineType=cv2.LINE_AA) cv2.putText(img,classes[int(l)],(x1,y1-2), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,111,222), 3, cv2.LINE_AA) img_lists.append(cv2.resize(img, (1280, 720))) image = np.concatenate([np.concatenate(img_lists[:2], axis=1), np.concatenate(img_lists[2:], axis=1)], axis=0) plt.rcParams["figure.figsize"] = (20, 10) plt.imshow(image[:,:,::-1]) plt.axis('off') plt.show()【准备mindyolo模型】链接:mindyolo# 步骤1:从OBS迁移数据集 import moxing as mox mox.file.copy_parallel("obs://trafficbuckets/source_code/mindyolo.zip", "/home/ma-user/work/mindyolo.zip") # 形参:源文件->指定位置【修改配置文件】1.yolov8n.yaml以及其继承的coco.yaml,hyp.scratch.low.yaml,yolov8-base.yaml的配置信息coco.yamldata: dataset_name: update_traffic_sign # you can change! train_set: /home/ma-user/work/dataset/update_traffic_sign/train2017.txt # ./coco/train2017.txt # 118287 images # you can change! val_set: /home/ma-user/work/dataset/update_traffic_sign/val2017.txt # ./coco/val2017.txt # 5000 images # you can change! test_set: /home/ma-user/work/dataset/update_traffic_sign/test2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794 # you can change! nc: 16 # class names names: ['i1', 'i10', 'i11', 'i12', 'i13', 'i14', 'i15', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9', 'i50'] # you can change! train_transforms: [] test_transforms: []yolov8-base.yamlepochs: 500 # total train epochs # you can change! per_batch_size: 2 # 16 * 8 = 128 img_size: 2048 iou_thres: 0.7 conf_free: True sync_bn: True opencv_threads_num: 0 # opencv: disable threading optimizations network: model_name: yolov8 nc: 16 # number of classes # you can change! reg_max: 16 stride: [8, 16, 32] ...【执行训练】python train.py --config ./configs/yolov8/yolov8n.yaml --run_eval True
  • [热门活动] StoryDiffusion漫画创作节活动分享-VOD/创意
    看到有 绘梦AI:StoryDiffusion漫画创作节的活动, 迫不及待的前来参加。整环境到模型,过程非常简单,傻瓜式操作,到了激动人心的模型测试部分。测点什么呢?有例子,先试一试:嗯,效果还不错,那我测测什么呢。。。作为一个球迷,昨晚刚好有欧冠,曼城又没赢,3球领先被逼平,瓜瓜鼻子都挠破了。。。测这个吧来, 角色文字描述:[Guardiola]A man wearing a black suit, bald原谅我,必须特点突出~~~接下来漫画描述:[Guardiola]  Manchester city football club coach [Guardiola] in an UEFA Champions League match [Guardiola] vs Feyenoord football club [NC]The scoreboard displays 3-0. [Guardiola]Leading 3:0  [NC]The scoreboard displays 3-3. [Guardiola]tie 3:3 [Guardiola]scratched his nose [Guardiola]cry结果如下: ①嗯,看着不太像教练。。。②咦,这张有点小帅。。。③额,这是上场了哈。。。④嗯?3:0去哪了呢。。。⑤嗯,淡定。。。⑥额?3:3跑哪去了,这记分牌记啥呢。。。⑦哈哈,保持风度。。。⑧受不了了。。。⑨哭吧哭吧不是罪。。。。整体体验感还不错,一些专业的领域,可能需要自己提供图片吧。耗时也不算长,挺有意思的。就这样~~
  • [优秀实践] 【AI Agent开发场景实践案例】基于模型平台ModelArts Studio和开源Agent框架Dify.AI构建聊天助手实践
    ModelArts Studio是华为云推出的模型即服务平台,内置了多款主流开源大模型,可以部署为服务后直接调用API;Dify.AI是业界主流的Agent应用开发框架,可以基于编排工作流轻松构建类似聊天助手、知识库等AI应用。本文就分享了基于ModelArts Studio和Dify.AI构建聊天助手的实践准备工作:1)有华为云账号,且经过实名认证操作步骤:一、基于华为云资源编排服务(RFS)快速部署Dify软件华为云资源编排服务RFS基于业界事实标准HCL,能够在云服务器上基于资源栈模版快速的部署Dify软件,用户只关注终态资源规格,无需感知底层资源申请等复杂环节。1)创建资源栈:基于提供的Dify资源栈模版创建资源栈,登陆华为云账号,点击创建资源栈,点击下一步2)参数配置。配置ECS服务器密码,点击下一步3) 资源栈设置。设置RFS编排服务对云服务器资源的操作权限,也可以不设置(非必选)直接点击下一步4)配置确认。最后一步确认下配置,创建执行计划,执行计划名称自定义,点击创建即可5)启动部署。部署Dify软件,点击部署按钮,弹出对话框中点击执行,当"事件"页签出现"Apply required resource success"时表明部署成功6)登陆Dify开发平台,刷新页面,在“输出”中查看Dify-LLM应用开发平台访问说明,首次登陆需注册管理员账号,依次填写邮箱、账号、密码。二、在Dify中使用MaaS的模型服务构建聊天助手应用1)进入华为云控制台,区域切到华东二,服务列表中找到ModelArts,2)进入ModelArts Studio,点击左侧栏"模型部署",申请大模型免费tokens试用,  3)以Qwen2_5-72B-Instruct为例,点击更多-调用,获取接口和模型名4)创建API Key,左侧鉴权管理-创建API Key,保存创建的密钥信息5)Dify平台上配置模型供应商,点击右上角设置,进入模型供应商页签,选择OpenAI-API-compatible供应商关键信息配置如下:-"模型名称"请填入步骤四服务信息中的模型名称-"API Key" 请填入步骤五中创建的API Key-"API endpoint URL"请填入步骤四中的API地址,并且删除最后面的“chat/completions”部分"Completion mode"请选择对话6)应用构建,在Dify中创建聊天助手时,可以选择已配置的MaaS模型服务进行应用编排
  • [圈层活动] 【报名申请千万Token免费使用】MaaS体验官来啦!
    MaaS体验官来啦!👉🏻什么是Maas?Model-as-a-Service( MaaS ) “模型即服务” 是云计算领域一种新的服务模式,是将机器学习模型部署到企业端提供给用户使用的服务。区别于售卖算力服务器为主的Iaas服务,MaaS服务为用户提供一站式的大模型(AI)开发和使用平台,通过MaaS,开发人员可以简单调用模型,无需了解复杂算法和实现细节。MaaS帮助企业实现高效智能的数据分析和决策,降低模型部署门槛。📣可体验内容:--千万Token免费使用--30+主流开源大模型支持--零代码、免配置的一站式模型开发托管服务💡体验流程:(11月26日-11月29日)1、群接龙报名:在微信群中报名,尚未报名的开发者,请添加【HCDE小助手】微信号​2、申请体验白名单:申请权限将于T+1日内完成审核,完成后即可开启体验申请链接:https://console.huaweicloud.com/modelarts/?region=cn-east-4&locale=zh-cn#/model-studio/homepage3、提交意见反馈,:提交意见反馈,请通过华为云云声平台反馈反馈标题模板:【HCDE体验官第三期】xxxxxxx(VOD标题)VOD提交链接:https://bbs.huaweicloud.com/suggestion3、参加线上座谈会(11月29日)参加华为云组织的线上座谈会,畅所欲言,与华为技术专家共同交流🎁 欢迎各位开发者踊跃报名,本次报名名额有限,资源申满即止欢迎大家提交各类意见反馈,反馈被采纳的,有机会获得神秘奖品~!相关链接:资源申请链接:https://console.huaweicloud.com/modelarts/?region=cn-east-4&locale=zh-cn#/model-studio/homepagetoken领取链接:https://console.huaweicloud.com/modelarts/?agencyld=ef402ec2claf4387b285c7b71619b846&region=cn-east-4&locale=zh-cn#/model-studio/deployment
  • [参赛经验分享] 2024华为开发者大赛优秀开发者故事,见证创新之花竞相绽放
    引言开发者,是用代码改变世界的人,应用是开发者解决场景问题、创造显性价值的最直接载体。而华为开发者大赛正是为开发者提供放飞创新思维、打造创新应用、展示实用价值的舞台。2024华为开发者大赛中国赛区半决赛已然落幕,全球总决赛静待开启。让我们走近这些优秀的企业、高校开发者案例,共同见证每一朵创新的花朵绽放,迎接未来每一个发展的新阶段。AI改变生活开启家居美学新篇章 AI赋能千行百业,未来的家居设计会是什么样子?“通过AIGC 技术打通消费者购物车商品到空间呈现的链路,让每个人都能进行DIY家装设计。”这是生境科技联合创始人钟鸿毅的回答。生境科技聚焦于室内空间AI设计系统研发,目前已针对B端家装公司和C端客户分别推出“生境AI”设计平台和“闪境AI”家装商城,并与金牌橱柜、万华集团等达成了商业合作。在钟鸿毅看来,3D设计自动化是生境科技的核心竞争力:一方面利用图像大模型,在京东、淘宝等电商平台几十万的家具产品都可以通过上传一张图片生成3D模型;另一方面基于团队异形建筑经验,参数化技术可以自动生成不同布局的柜体家具,适配各种各样的户型。“作为初创公司,要考虑图像模型训练测试成本,也要考虑算法稳定性、产品能力,华为云给了我们很大支持。”在经过多方尝试后,生境科技选择了AI开发平台ModelArts等华为云产品作为项目底座,钟鸿毅表示。通过参加华为开发者大赛,生境科技更深入地了解华为的生态以及技术赋能,未来希望可以结合华为的能力走进千家万户,尤其是智慧家居领域进行联动智慧零售打造便捷高效购物体验随着技术进步和消费者需求变化,打通线上线下渠道提供一致且个性化的购物体验成为零售业的痛点。在2024华为开发者大赛上,武汉快特信息技术有限公司的智慧新零售数字化解决方案获得企业赛道湖北赛区一等奖。“我们从2015年开始研发推广智慧零售产品,主要瞄准销售额达到一定规模的零售企业,由于市场竞争、财务管理等因素,标准化产品难以满足客户需求。”项目负责人王世虎介绍道,企业偏向私有化部署和定制。“定制化服务和增值服务是我们的核心竞争力,既要理解计算机语言,还要学习财务知识,更要做到数据安全、问题修复的及时响应。”武汉快特在21年起将智慧新零售产品华为云平台深度绑定,并于今年入驻了华为云商店,已经收获了海外客户。王世虎介绍,产品技术体系基于Java,使用了华为云中间件、RDS数据库等技术,且已获鲲鹏平台认证。谈到未来,他期待华为能继续提供强大的技术能力支持,带来更多优惠和展示机会,双方战略合作伙伴关系越走越远。RPA +AI打造大模型驱动的领先数字员工大模型驱动的生成式AI技术爆发,为数字员工带来全新发展机遇。句子互动作为全球最大的对话式RPA开源框架的商业化公司,以独创的Agent八大生命周期为理论依据,通过「RPA - 运营服务一体化平台」和「AI-Agent工作流引擎」两款产品,助力企业数字化转型。“与消费者建立链接的效率和成本是很多企业的痛点,我们主要面向消费品牌、泛互联网、金融等领域客户。”祁国良介绍道,基于大模型、数据、SOP数字员工构建方案,句子互动打造能力领先的数字员工。句子互动80%左右的客户来自国内,基于技术能力和合作客户认可双重因素,数字底座最终选择了华为云。目前句子互动产品覆盖四亿用户、消息条数将近70亿条,业务增长驱动双方一直紧密合作。与华为专家一起探讨交流,让应用落地更流畅,这是句子互动参加开发者大赛的初衷。祁国良通过华为专家技术指导、开发者社区等平台支持,未来将资源利用到极致,提高效率降低成本,也增强客户体验。情系公益用AI智能设备让盲人“看见”青年的动人之处,在于他们的勇气和担当,展现非凡的创造探索精神。在本次华为开发者大赛,来自武汉工程大学计算机学院物联网专业的王丞辉和团队带来“智行无界——华为云生态下盲人出行一体化解决方案”,得到众多华为专家的肯定。“参加公益活动时发现无障碍环境普遍缺失,就萌生了用智能化设备来充当盲人眼睛的想法。”这是王丞辉的出发点,将设备所看到的信息通过计算机视觉技术转化成自然语言,让盲人对世界有更加清晰的认知。目前团队正在开发智能盲杖、智能导盲眼镜和导盲机械狗,前两者开发已经比较成熟并进行了测试。团队整套智能设备开发均基于华为云平台进行,这源于王丞辉学习经历。由于学校与华为合作密切,王丞辉在实习时对人工智能开发产生了浓厚的兴趣,在老师的支持下通过了华为HCIA-AI的认证。在王丞辉看来,华为生态协同性非常好,可以用更少的代码实现功能开发、算法部署更加方便,用更少的计算资源实现更多的效果,为团队开发提供非常大的帮助,用智能化设备来帮助盲人拥有更好的出行体验,项目前景也十分广阔。科技赋能让手语“翻译”文字更加顺畅科技改变世界,让生活更美好。在华为开发者大赛上,公益项目不断涌现,来自厦门大学的大三学生李天一和团队的“手与”项目正是另一个典型案例。在特殊教育学校的工作经历,让李天一发现听障人士的手语分为官方手语与本土手语,而手语常用语内容高达8000多种,并没有完全统一,听障人士要融入社会格外困难。“简单来说,我们是想训练模型,通过手机识别,将手语顺畅地翻译为文字,在未来期待能实现双向交流。”李天一总结道,并介绍项目当前还处在demo阶段,收集数据是重点,团队正联合高校伙伴收集地方手语数据,并基于昇腾框架、华为云AI开发平台ModelArts开展数据集处理、模型训练、模型部署等一系列开发流程。李天一称,参加华为开发者大赛能够与众多团队进行交流学习,这激发了创新思维,实现了“以赛促学”,可推动团队和个人快速成长。提及未来,李天一表示无论是对于学生还是企业而言,华为云开发者社区组织都提供了大量资源,构建了交流经验的平台,对开发者的成长具有重要意义。他期待华为能够发展更多的开发者伙伴,将生态建设得更加完善。写在最后每一位开发者都了不起,每一个开发者的故事都值得被聆听,他们的每一个代码、每一个想法,都可能成为改变未来的关键。华为将持续践行‘一切皆服务’的理念,致力于构建一个更加开放,更加协同创新的环境,提供更加高效、便捷的工具和资源,与开发者共同前行。
  • [ModelArts昇...] StoryDiffusion漫画创作节活动分享-VOD/创意
    一.仅基于文本生成:(1) 角色文字描述[Child] A little boy, dressed in a red football uniform.[Father]A father, wearing a white shirt.(2) 样式模板(3) 漫画描述(每行对应一帧,建议传入英文)[Father] In the yard, reading a football magazine. # In the yard, the magazine said that there was a wonderful football field newly built in the city center.[Father] On the way to the new football field.[Child] Making a phone call in the room. # [Father] invited [Child] to play football with him.[NC] In the evening, a group of excellent young football players appeared on the football field.[NC] There was a car by the roadside near the new football field. # They drove to the new football field to play football.[Father] Very excited, grinning on the football field in the evening.[Child] Very excited, grinning on the football field in the evening.[Father] and [Child] Running merrily on the football field in the evening.[NC] In the evening, there was a professional football training hall on the football field. # Suddenly, they discovered that wonderful training hall![Father] and [Child] Cheering in the training hall full of football equipment in the evening. # He was extremely happy in the training hall.二.中文释义:[孩子] 一个小男孩,穿着红色的足球服。 [父亲] 一位父亲,穿着白色的衬衫。[父亲] 在院子里,看足球杂志。#在院子里,杂志上说城市中心新建了一个超棒的足球场。[父亲] 在去往新足球场的路上。[孩子] 在房间里打电话。# [父亲] 邀请[孩子] 和他一起去踢球。[无具体人物,以下简称“某情况”] 傍晚,球场上出现了一群厉害的足球少年。 [某情况] 在新足球场附近的路边有一辆车。#他们开车前往新足球场准备踢球。[父亲] 非常兴奋,傍晚在球场上咧着嘴。[孩子] 非常激动,傍晚在球场上咧着嘴。[父亲] 和[孩子] 在傍晚的球场上欢快地奔跑。[某情况] 傍晚,球场上有一个专业的足球训练馆。#突然,他们发现了那个超棒的训练馆![父亲] 和[孩子] 在满是足球设备的训练馆里,傍晚欢呼起来。#他们在训练馆里开心极了。三.问题:  本想通过图像生成工具得到满意的画面,可结果却令人哭笑不得。最初生成的图片里,人物“Father”一开始呈现出白种人的模样,可不知怎的,转眼间竟变成了黄种人的形象,着实让人诧异。而那个穿着红色足球服的小男孩,明明身处足球场,该是一副活力满满准备踢球的样子,却莫名其妙地戴着一顶棒球帽,与整个足球场景格格不入,这些意外的变化让原本期待的画面变得满是违和感,实在是有些无奈呀。四.建议或感受:  使用图像生成工具时遇到这样的情况,实在是有些令人困扰。原本满心期待能得到精准呈现设定的画面,结果却大相径庭。这不仅影响了创作的连贯性和预期效果,也凸显出当前图像生成技术在细节把控上的不足。对于创作者而言,可能会浪费大量时间在反复调整和尝试上,降低创作效率。而且这些不合理的变化也会削弱作品的专业性和可信度。希望图像生成技术能够不断优化,提高对人物特征、场景元素等细节的精准度,减少这类莫名其妙的偏差,从而更好地服务于创作者的需求。
  • [问题求助] 训练模型时报错Launch graph failed, graph id:1
    使用Ascend训练模型时,报错Launch graph failed, graph id:1