libtorch+torchvision windows编译

libtorch建议直接采用官方的预编译版本,对应好torchvision版本做编译。

1. libtorch预编译版本下载

libtorch官方下载地址
在这里插入图片描述

Pybind11编译

git clone https://github.com/pybind/pybind11.git
cd pybind11
mkdir build
(base) PS E:\project\pybind11-2.13.1> cd .\build\
(base) PS E:\project\pybind11-2.13.1\build> cmake -DPYBIND11_TEST=OFF -DCMAKE_INSTALL_PREFIX="..\install" ..
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22621.
-- pybind11 v2.13.1
-- CMake 3.30.0-rc4
-- Python 3.11.4
-- pybind11::lto enabled
-- pybind11::thin_lto enabled
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: E:/project/pybind11-2.13.1/build
(base) PS E:\project\pybind11-2.13.1\build> cmake --install .
-- Install configuration: "Release"
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/attr.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/buffer_info.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/cast.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/chrono.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/common.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/complex.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/class.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/common.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/descr.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/init.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/internals.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/typeid.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/detail/type_caster_base.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eigen
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eigen/common.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eigen/matrix.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eigen/tensor.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eigen.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/embed.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/eval.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/functional.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/gil.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/gil_safe_call_once.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/iostream.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/numpy.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/operators.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/options.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/pybind11.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/pytypes.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/stl
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/stl/filesystem.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/stl.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/stl_bind.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/type_caster_pyobject_ptr.h
-- Installing: E:/project/pybind11-2.13.1/install/include/pybind11/typing.h
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11Config.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11ConfigVersion.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/FindPythonLibsNew.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11Common.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11Tools.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11NewTools.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11GuessPythonExtSuffix.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/cmake/pybind11/pybind11Targets.cmake
-- Installing: E:/project/pybind11-2.13.1/install/share/pkgconfig/pybind11.pc

zlib编译

git clone https://github.com/madler/zlib.git
cd zlib

zlib提供了vc17的工程,在zlib\contrib\vstudio\vc17\zlibvc.sln中,注意编译x64版本的库。注意直接编译会报错,在VERSION前面增加一个;注释掉这一行即可
在这里插入图片描述

生成开始于 18:23...
1>------ 已启动生成: 项目: zlibvc, 配置: Release x64 ------
1>  正在创建库 x64\ZlibDllRelease\zlibwapi.lib 和对象 x64\ZlibDllRelease\zlibwapi.exp
1>正在生成代码
1>267 of 268 functions (99.6%) were compiled, the rest were copied from previous compilation.
1>  0 functions were new in current compilation
1>  0 functions had inline decision re-evaluated but remain unchanged
1>已完成代码的生成
1>zlibvc.vcxproj -> E:\project\zlib\contrib\vstudio\vc17\x64\ZlibDllRelease\zlibwapi.dll
========== 生成: 1 成功,0 失败,0 最新,0 已跳过 ==========
========== 生成 于 18:23 完成,耗时 00.644 秒 ==========

libpng编译

git clone https://github.com/pnggroup/libpng.git

libpng提供了visualstudio的工程,在libpng\projects\vstudio\vstudio.sln中,注意切换平台为x64。
注意:vstudio默认认为zlib工程文件夹与libpng同级,注意上一步操作如果不是git clone 下来的库,需要修改文件夹名为zlib。同样主意编译x64版本的库。

2>All 573 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
2>已完成代码的生成
2>libpng.vcxproj -> E:\project\libpng-1.6.43\projects\vstudio\x64\Release\libpng.dll
2>已完成生成项目“libpng.vcxproj”的操作。
========== 生成: 2 成功,0 失败,1 最新,0 已跳过 ==========
========== 生成 于 18:29 完成,耗时 02.949 秒 ==

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/768128.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

STMF4学习笔记(天空星)

前言:本篇笔记参考嘉立创文档,连接放在最后 #RTC相关概念定义 Real-Time Clock 缩写 RTC 翻译 实时时钟,是单片机片内外设的一种,作用于提供准确的时间还有日期,这个外设有独立的电源,当单片机停止供电…

Vue移动端地图App:van-uploader导致的卡顿问题

问题描述 基于Vue3+Vant IU 4开发的移动端地图App,在进行地图点位上报、上报记录查看过程中,出现App卡顿、甚至闪退的问题,进行问题定位之后,发现是van-uploader组件导致的问题。 van-uploader文件上传组件 van-uploader组件用于将本地的图片或文件上传至服务器,并在上传…

番外篇 | 斯坦福提出即插即用二阶优化器Sophia :相比Adam实现2倍加速,显著节省大语言模型训练成本

前言:Hello大家好,我是小哥谈。大模型的预训练成本巨大,优化算法的改进可以加快模型的训练时间并减少训练开销。目前大模型的训练优化器基本上都采用Adam及其变体,并且Adam的应用已经有9个年头了,在模型优化方面相当于霸主的地位。但是能否够在优化器方面提高模型预训练效…

第15届蓝桥杯Python青少组选拔赛(STEMA)2023年8月真题-附答案

第15届蓝桥杯Python青少组选拔赛(STEMA)2023年8月真题 题目总数: 11 总分数: 400 一、单选题 第 1 题 单选题 以下不符合 Python 语言变量命名规则的是( )。 A. k B. 2_k C. _k D. ok 答案 B …

全面解析自然语言处理(NLP):基础、挑战及应用前景

自然语言处理 (NLP) 简介与应用前景 自然语言处理(NLP)是人工智能和计算语言学的一个分支,致力于使计算机能够理解、解释和生成人类语言。这篇博文将深入探讨自然语言处理的基础知识、挑战、典型任务及其广泛的应用前景。 一、自然语言处理的…

企业部署 LLM 的四种方法

目录 生产环境中的四种 LLM 方法1. 基于上下文的提示工程 -- Prompt Engineering2. 检索增强生成 -- RAG3. 微调模型 -- Fine Tune4. 训练模型参考随着大型语言模型 (LLM) 的快速发展,企业正积极探索其用例,并将首批生成式 AI 应用部署到生产环境中。自今年 LLM 或 LLMOps 真…

全网最详细的软件测试面试题总结+基础知识(完整版)

一、什么是软件? 软件是计算机系统中的程序和相关文件或文档的总称。 二、什么是软件测试? 说法一:使用人工或自动的手段来运行或测量软件系统的过程,以检验软件系统是否满足规定的要求,并找出与预期结果之间的差异…

python3.8安装详细教程

python3.8下载及安装详细教程 Python 3.8 是一个重要的Python版本,它引入了一系列新功能和改进。以下是对Python 3.8的详细概述,包括其关键特性、安装方法以及版本状态等信息。 Python 3.8的关键特性 海象运算符(Walrus Operator&#xff09…

字符串操作函数

目录 一.strlen函数 二.strcpy函数 三.strcat函数 四.strcmp函数 五.strncpy函数 六.strncat函数 七.strncmp 函数 八.strstr函数 九.strtok函数 十.strchr函数 十一.strrchr函数 十二.strpbrk函数 十三.strspn函数 十四.strcspn函数 一.strlen函数 size_t str…

yaklang window安装 vscode运行得到“hello world”

资源来源:旅程伊始:Yak 语言环境安装与搭建环境 | Yak Program Language 安装yak语言非常简单,管理员权限打开命令行运行以下命令: powershell (new-object System.Net.WebClient).DownloadFile(https://yaklang.oss-cn-beijing…

“穿越时空的机械奇观:记里鼓车的历史与科技探秘“

在人类文明的发展历程中,科技的创新与进步不仅仅推动了社会的进步,也为我们留下了丰富的文化遗产。记里鼓车,作为一种古老的里程计量工具,其历史地位和技术成就在科技史上具有重要的意义。本文将详细介绍记里鼓车的起源、结构原理…

MySQL数据库设计作业 ——《网上书店系统》数据库设计实验报告

数据库设计作业——《网上书店系统》数据库设计 一、功能需求 普通用户:可以进行最基础的登陆操作,可浏览图书、按类别查询图书、查看 图书的详细信息,还可以注册成为会员。会员:需要填写详细信息(真实姓名、性别、手…

SSM学习4:spring整合mybatis、spring整合Junit

spring整合mybatis 之前的内容是有service层&#xff08;业务实现层&#xff09;、dao层&#xff08;操作数据库&#xff09;&#xff0c;现在新添加一个domain&#xff08;与业务相关的实体类&#xff09; 依赖配置 pom.xml <?xml version"1.0" encoding&quo…

springboot+vue+mybatis企业保修系统+PPT+论文+讲解+售后

企业管理系统提供给用户一个企业信息管理的系统&#xff0c;最新的企业信息让用户及时了解企业管理动向,,还能通过交流区互动更方便。本系统采用了B/S体系的结构&#xff0c;使用了java技术以及MYSQL作为后台数据库进行开发。系统主要分为系统管理员、员工和主管三个部分&#…

【C语言】手撕结构体内存对齐

©作者:末央&#xff06; ©系列:C语言初阶(适合小白入门) ©说明:以凡人之笔墨&#xff0c;书写未来之大梦 目录 结构体对齐规则结构体大小计算 - 三步曲 结构体对齐规则 怎么计算结构体的内存大小。这就涉及到结构体内存对齐的问题。 结构体的第⼀个成员对⻬到…

项目实战--MySQL实现分词模糊匹配

一、需求描述 推广人员添加公司到系统时&#xff0c;直接填写公司简称&#xff0c;而公司全称可能之前已经被添加过&#xff0c;为防止添加重复的公司&#xff0c;所以管理员在针对公司信息审批之前&#xff0c;需要查看以往添加的公司信息里是否有相同公司。 二、方案 技术…

项目2:API Hunter 细节回顾 -1

一. 接口调用 对于开发者来说&#xff0c;接口的调用应当是方便快捷的&#xff0c;而且出于安全考虑&#xff0c;通常会选择在后端调用第三方 API&#xff0c;避免在前端暴露诸如密码的敏感信息。 若采用 HTTP 调用方式&#xff1a; HttpClientRestTemplate第三方库&#xf…

【JavaWeb】登录校验-会话技术(一)Cookie与Session

登录校验 实现登陆后才能访问后端系统页面&#xff0c;不登陆则跳转登陆页面进行登陆。 首先我们在宏观上先有一个认知&#xff1a; HTTP协议是无状态协议。即每一次请求都是独立的&#xff0c;下一次请求并不会携带上一次请求的数据。 因此当我们通过浏览器访问登录后&#…

py黑帽子学习笔记_burp

配置burp kali虚机默认装好了社区版burp和java&#xff0c;其他os需要手动装 burp是用java&#xff0c;还得下载一个jython包&#xff0c;供burp用 配apt国内源&#xff0c;然后apt install jython --download-only&#xff0c;会只下载包而不安装&#xff0c;下载的目录搜一…

【JVM-05】Java内存区域(运行时数据区)、对象创建过程、内存布局

【JVM-05】Java内存区域即运行时数据区、对象创建过程、内存布局 1. 介绍下Java内存区域(运行时数据区)1.1 程序计数器(线程私有)1.2 虚拟机栈(线程私有)1.3 本地方法栈(线程私有)1.4 Java堆(线程共享)1.5 方法区(线程共享)1.5.1 方法区和永久代的关系1.5.2 常用参数1.5.3 为什…