[{"data":1,"prerenderedAt":336},["ShallowReactive",2],{"content-query-hfNtIR4zJo":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":330,"_id":331,"_source":332,"_file":333,"_stem":334,"_extension":335},"/technology-blogs/zh/3587","zh",false,"","基于MindSpore香橙派AIpro实现垃圾回收AI识别方案四：SOWT分析与总结","作者：完美记号   原文链接：https://www.hiascend.com/developer/blog/details/0265158167508388542","2025-01-23","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/3939bcbe916941c7b37d22f38fb11e0e.png","technology-blogs","开发者分享",{"type":15,"children":16,"toc":327},"root",[17,25,37,53,58,66,71,79,84,92,100,110,118,126,134,142,150,158,165,170,178,183,191,196,201,206,214,219,224,229,237,242,247,255,260,265,272,277,285,290,297,302,310,315,322],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"基于mindspore香橙派aipro实现垃圾回收ai识别方案四sowt分析与总结",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29,31],{"type":24,"value":30},"**作****者：**",{"type":18,"tag":32,"props":33,"children":34},"strong",{},[35],{"type":24,"value":36},"完美记号",{"type":18,"tag":26,"props":38,"children":39},{},[40,42],{"type":24,"value":41},"**原文链接：**",{"type":18,"tag":32,"props":43,"children":44},{},[45],{"type":18,"tag":46,"props":47,"children":51},"a",{"href":48,"rel":49},"https://www.hiascend.com/developer/blog/details/0265158167508388542",[50],"nofollow",[52],{"type":24,"value":48},{"type":18,"tag":26,"props":54,"children":55},{},[56],{"type":24,"value":57},"通过本系列上文可以体验一下我们从0到1可以快速的搭建属于自己的AI系统，非常的方便与快捷，这里分享一下以前自己搭建一个能使用的AI应用有多么繁琐。",{"type":18,"tag":26,"props":59,"children":60},{},[61],{"type":18,"tag":32,"props":62,"children":63},{},[64],{"type":24,"value":65},"Stable Diffusion介绍",{"type":18,"tag":26,"props":67,"children":68},{},[69],{"type":24,"value":70},"Stable Diffusion是一种基于扩散过程的图像生成模型，可以生成高质量、高分辨率的图像。它通过模拟扩散过程，将噪声图像逐渐转化为目标图像。这种模型具有较强的稳定性和可控性，可以生成具有多样化效果和良好视觉效果的图像。",{"type":18,"tag":26,"props":72,"children":73},{},[74],{"type":18,"tag":75,"props":76,"children":78},"img",{"alt":7,"src":77},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/620b6f312348401c96913c7398a11519.png",[],{"type":18,"tag":26,"props":80,"children":81},{},[82],{"type":24,"value":83},"Stable Diffusion 可以通过生成多样化、高质量的图像、修复损坏的图像、提高图像的分辨率和应用特定风格到图像上等方式，辅助视觉创意的实现，它为视觉艺术家、设计师等提供更多的创作工具和素材，促进视觉艺术领域的创新和发展。",{"type":18,"tag":26,"props":85,"children":86},{},[87],{"type":18,"tag":32,"props":88,"children":89},{},[90],{"type":24,"value":91},"对比服务器自行部署痛点",{"type":18,"tag":26,"props":93,"children":94},{},[95],{"type":18,"tag":32,"props":96,"children":97},{},[98],{"type":24,"value":99},"1、安装基本软件：",{"type":18,"tag":101,"props":102,"children":104},"pre",{"code":103},"sudo apt install wget git\n",[105],{"type":18,"tag":106,"props":107,"children":108},"code",{"__ignoreMap":7},[109],{"type":24,"value":103},{"type":18,"tag":26,"props":111,"children":112},{},[113],{"type":18,"tag":32,"props":114,"children":115},{},[116],{"type":24,"value":117},"2、安装python 3.10.6",{"type":18,"tag":101,"props":119,"children":121},{"code":120},"# 安装依赖\nsudo apt install wget git python3 python3-venv\n# 删除默认的低版本\nwhich python3\nsudo rm /usr/bin/python\n# 配置软链接\nls -lh /usr/bin | grep python\nln -s /usr/bin/python3 /usr/bin/python\n# 若是GPU环境的用户需要安装与cuda版本对应的torch\npip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117\n# pip换源\npip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple\n# 安装对应依赖\n\npip install -r requirements_versions.txt\n# 建立虚拟环境\nsudo apt-get install python3.5-venv\npython3 -m venv_name\nsource venv_name/bin/activate\n",[122],{"type":18,"tag":106,"props":123,"children":124},{"__ignoreMap":7},[125],{"type":24,"value":120},{"type":18,"tag":26,"props":127,"children":128},{},[129],{"type":18,"tag":32,"props":130,"children":131},{},[132],{"type":24,"value":133},"3、安装CUDA",{"type":18,"tag":101,"props":135,"children":137},{"code":136},"# 下载Cuda\nwget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run\n# 安装cuda\nsudo sh cuda_11.8.0_520.61.05_linux.run\n# 配置环境变量\n# 增加下面两行内容，并保存\nvim ~/.bashrc\nexport PATH=/usr/local/cuda-11.8/bin:$PATH\nexport LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH\n# 使配置文件生效\nsource ~/.bashrc\n",[138],{"type":18,"tag":106,"props":139,"children":140},{"__ignoreMap":7},[141],{"type":24,"value":136},{"type":18,"tag":26,"props":143,"children":144},{},[145],{"type":18,"tag":32,"props":146,"children":147},{},[148],{"type":24,"value":149},"4、安装stable diffusion",{"type":18,"tag":101,"props":151,"children":153},{"code":152},"# 拉取stable diffusion 代码：\ngit clone GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI\n# 安装stable diffusion：\ncd stable-diffusion-webui/\n# 启动\n./webui.sh\n",[154],{"type":18,"tag":106,"props":155,"children":156},{"__ignoreMap":7},[157],{"type":24,"value":152},{"type":18,"tag":26,"props":159,"children":160},{},[161],{"type":18,"tag":75,"props":162,"children":164},{"alt":7,"src":163},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/617141cd0d4d47859a2f273765e9720b.png",[],{"type":18,"tag":26,"props":166,"children":167},{},[168],{"type":24,"value":169},"以上是自行尝试购买某云GPU服务器，自己手动搭建环境，并运行stable diffusion。大概花费了差不多一个下午的时间，而且这个还是自己以前尝鲜有过经验的前提下。",{"type":18,"tag":26,"props":171,"children":172},{},[173],{"type":18,"tag":32,"props":174,"children":175},{},[176],{"type":24,"value":177},"搭建自己的AI应用的痛点",{"type":18,"tag":26,"props":179,"children":180},{},[181],{"type":24,"value":182},"自己组建AI的痛点，无论是从概念设计到最终部署，都面临着一系列的痛点，主要包括以下点：",{"type":18,"tag":26,"props":184,"children":185},{},[186],{"type":18,"tag":32,"props":187,"children":188},{},[189],{"type":24,"value":190},"①技术复杂性：",{"type":18,"tag":26,"props":192,"children":193},{},[194],{"type":24,"value":195},"(1). 算法选择与实现：选择合适的AI算法（如深度学习、机器学习、自然语言处理等），不同算法有不同的适用场景和性能表现，选择不当会导致最终应用的效果不佳。",{"type":18,"tag":26,"props":197,"children":198},{},[199],{"type":24,"value":200},"(2). 框架与库的选择：市面上存在多种AI框架和库（如TensorFlow、PyTorch等），每种框架都有其优缺点，选择合适的框架和库以支持应用需求是一个重要的决策。",{"type":18,"tag":26,"props":202,"children":203},{},[204],{"type":24,"value":205},"(3). 模型优化与部署：模型训练完成后，需要对其进行优化以提高性能和准确性，并考虑如何将其部署到生产环境中，其中包括选择合适的硬件平台、处理并发请求、优化响应时间等。",{"type":18,"tag":26,"props":207,"children":208},{},[209],{"type":18,"tag":32,"props":210,"children":211},{},[212],{"type":24,"value":213},"②资源限制：",{"type":18,"tag":26,"props":215,"children":216},{},[217],{"type":24,"value":218},"(1). 计算资源：AI应用的训练和推理过程通常需要大量的计算资源，包括CPU、GPU甚至TPU，这些资源成本高昂。",{"type":18,"tag":26,"props":220,"children":221},{},[222],{"type":24,"value":223},"(2). 存储资源：训练数据和模型本身也需要大量的存储空间，随着数据量的增加，存储成本也会不断上升。",{"type":18,"tag":26,"props":225,"children":226},{},[227],{"type":24,"value":228},"(3). 技术人才：AI应用的开发需要专业的技术人才，包括数据科学家、机器学习工程师等，往往这些人才在市场上供不应求，且成本较高。",{"type":18,"tag":26,"props":230,"children":231},{},[232],{"type":18,"tag":32,"props":233,"children":234},{},[235],{"type":24,"value":236},"③数据问题：",{"type":18,"tag":26,"props":238,"children":239},{},[240],{"type":24,"value":241},"(1). 数据获取：高质量的数据是训练AI模型的关键。然而，在实际应用中，获取足够数量的高质量数据往往非常困难。",{"type":18,"tag":26,"props":243,"children":244},{},[245],{"type":24,"value":246},"(2). 数据标注：对于监督学习来说，数据标注是必不可少的一步。然而，数据标注既耗时又耗力，且需要专业知识。",{"type":18,"tag":26,"props":248,"children":249},{},[250],{"type":18,"tag":32,"props":251,"children":252},{},[253],{"type":24,"value":254},"④维护与更新：",{"type":18,"tag":26,"props":256,"children":257},{},[258],{"type":24,"value":259},"(1). 模型更新：随着新数据的不断涌现和算法的不断进步，AI模型需要定期更新以保持其准确性和有效性，这要求开发者具备持续维护的能力。",{"type":18,"tag":26,"props":261,"children":262},{},[263],{"type":24,"value":264},"(2). 性能监控：在生产环境中，AI应用的性能可能受到多种因素的影响（如硬件故障、网络延迟等）。因此，需要对应用的性能进行实时监控和调整。",{"type":18,"tag":26,"props":266,"children":267},{},[268],{"type":18,"tag":75,"props":269,"children":271},{"alt":7,"src":270},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/bfd8f72029a24e8d85996e2f8f587aec.png",[],{"type":18,"tag":26,"props":273,"children":274},{},[275],{"type":24,"value":276},"因为手里没有备用的TF卡，只能通过第二种方案换一种工具来进行烧录试试，如果网友可以成功启动，就不需要下一步操作。",{"type":18,"tag":26,"props":278,"children":279},{},[280],{"type":18,"tag":32,"props":281,"children":282},{},[283],{"type":24,"value":284},"昇思MindSpore大模型平台SOWT分析",{"type":18,"tag":26,"props":286,"children":287},{},[288],{"type":24,"value":289},"经过一个多月的昇思MindSpore大模型平台的使用与实践，可以很好的解决模型复杂度高、参数量大，对算力有极大的需求，基于昇思MindSpore大模型平台的主流框架进行大模型的开发，为大模型创新开发提供了完备的硬核技术，以下是个人的一个SOWT分析：",{"type":18,"tag":26,"props":291,"children":292},{},[293],{"type":18,"tag":75,"props":294,"children":296},{"alt":7,"src":295},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/ef0a0fa4b36442e295621cd541af00b9.png",[],{"type":18,"tag":26,"props":298,"children":299},{},[300],{"type":24,"value":301},"昇思MindSpore充分发挥原生支持大模型训练的能力，降低大模型创新开发门槛，为了让AI大模型更好地普惠大众，昇思社区打造了首个基于自主创新AI算力和框架、服务全球开发者的一站式大模型平台，将大模型的能力开放给开发者。",{"type":18,"tag":26,"props":303,"children":304},{},[305],{"type":18,"tag":32,"props":306,"children":307},{},[308],{"type":24,"value":309},"总结",{"type":18,"tag":26,"props":311,"children":312},{},[313],{"type":24,"value":314},"在如今向人工智能发展的变迁时代，“人工智能+”意味着人工智能只有赋能千行百业才能真正落地转化为价值，这也是昇思大模型平台AI框架的价值的体现所在。",{"type":18,"tag":26,"props":316,"children":317},{},[318],{"type":18,"tag":75,"props":319,"children":321},{"alt":7,"src":320},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/01/24/311e9f471d7e4953839c86bbebb39f40.png",[],{"type":18,"tag":26,"props":323,"children":324},{},[325],{"type":24,"value":326},"昇思人工智能框架作为算法应用和硬件算力之间的桥梁，持续帮助用户解决部署挑战。相信在不久的将来，伴随昇思MindSpore开源社区的壮大，生态圈持续繁荣，千行百业智能化产品将不断的发展。",{"title":7,"searchDepth":328,"depth":328,"links":329},4,[],"markdown","content:technology-blogs:zh:3587.md","content","technology-blogs/zh/3587.md","technology-blogs/zh/3587","md",1776506131649]