当前位置: 首页 > news >正文

网站建设的推广渠道网站制作学校

网站建设的推广渠道,网站制作学校,上海建科建设监理网站,如何做平台推广安装tensorRT#xff1a; 1、下载与电脑中cuda和cudnn版本对应的tensorRT#xff08;比如我的是TensorRT-8.2.1.8.Windows10.x86_64.cuda-11.4.cudnn8.2#xff09; 2、打开目录里面有python文件夹#xff0c;找到对应python版本的whl文件#xff08;我的是tensorrt-8.2… 安装tensorRT 1、下载与电脑中cuda和cudnn版本对应的tensorRT比如我的是TensorRT-8.2.1.8.Windows10.x86_64.cuda-11.4.cudnn8.2 2、打开目录里面有python文件夹找到对应python版本的whl文件我的是tensorrt-8.2.1.8-cp38-none-win_amd64.whl  因为我python安装的是3.8版本 3、终端安装pip install tensorrt-8.2.1.8-cp38-none-win_amd64.whl 4、结束 import tensorrt as trt def get_DynEngine(onnx_file_path, engine_file_path,patchsize,max_workspace_size,max_batch_size):Attempts to load a serialized engine if available,otherwise build a new TensorRT engine as save itTRT_LOGGER trt.Logger()trt.init_libnvinfer_plugins(TRT_LOGGER, )explicit_batch 1 (int)(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)builder trt.Builder(TRT_LOGGER)network builder.create_network(explicit_batch)config builder.create_builder_config()parser trt.OnnxParser(network, TRT_LOGGER)runtime trt.Runtime(TRT_LOGGER)print(common.EXPLICIT_BATCH:, explicit_batch)# 最大内存占用# 显存溢出需要重新设置config.max_workspace_size max_workspace_size # 256MBconfig.set_flag(trt.BuilderFlag.FP16)print(max_workspace_size:, config.max_workspace_size)builder.max_batch_size max_batch_size # 推理的时候要保证batch_sizemax_batch_sizeif not os.path.exists(onnx_file_path):print(fonnx file {onnx_file_path} not found,please run torch_2_onnx.py first to generate it)exit(0)print(fLoading ONNX file from path {onnx_file_path}...)with open(onnx_file_path, rb) as model:print(Beginning ONNX file parsing)if not parser.parse(model.read()):print(ERROR:Failed to parse the ONNX file)for error in range(parser.num_errors):print(parser.get_error(error))return Noneinputs [network.get_input(i) for i in range(network.num_inputs)]print(input, inputs)outputs [network.get_output(i) for i in range(network.num_outputs)]print(out:, outputs)print(Network Description)for input in inputs:# 获取当前转化之前的 输入的 batch_sizebatch_size input.shape[0]print(Input {} with shape {} and dtype {} . .format(input.name, input.shape, input.dtype))for output in outputs:print(Output {} with shape {} and dtype {} . .format(output.name, output.shape, output.dtype))# Dynamic input setting 动态输入在builder的profile设置# 为每个动态输入绑定一个profileprofile builder.create_optimization_profile()print(network.get_input(0).name:, network.get_input(0).name)profile.set_shape(network.get_input(0).name, (1,1, *patchsize), (1, 1,*patchsize),(max_batch_size, 1, *patchsize)) # 最小的尺寸,常用的尺寸,最大的尺寸,推理时候输入需要在这个范围内config.add_optimization_profile(profile)print(Completed parsing the ONNX file)print(fBuilding an engine from file {onnx_file_path}; this may take a while...)engine builder.build_serialized_network(network, config)print(Completed creating Engine)with open(engine_file_path, wb) as f:f.write(engine)return engineif __name__ __main__:get_DynEngine(1.onnx, 2.engine,[96,160,160],5*(130),2)
http://www.zqtcl.cn/news/4494/

相关文章:

  • 网站vr视角怎么做深圳坂田做网站
  • 大良网站建设如何帮人做兼职的网站吗
  • 下载别人网站的asp阿里云wordpress插件
  • 免费网站建站模板求职网站建设
  • 聊城企业网站建设费用光伏项目建设背景
  • 网站流量超限东莞公司建站哪个更便宜
  • 网站开发人员定罪案例网站建设服务器的选择方案
  • 网站开发属于什么模式主页面设计图片
  • 婚庆网站策划各种推广平台
  • 律师网站建设网站建设的价钱
  • 网站建设经验材料建设部标准规范网站
  • 做中文的云图网站网站怎么防k
  • 企业建设网站个人总结在线seo超级外链工具
  • 网站动画用什么程序做产品设计毕业作品集
  • 网站推广排名哪家公司好百度指数官网首页
  • 企业网站轮播图怎么做天津黄页企业名录
  • 网站开发招聘职位济南智能网站建设哪家便宜
  • 服务器做网站空间哪些行业做网站最重要
  • 做图文的网站曲阜市建设局网站
  • 电商网站建设基础ppt手机淘宝客网站怎么做的
  • 怎么建设维护学校的网站wordpress模板创建
  • 炒股网站开发上海外贸瓦屑包装袋有限公司
  • 什么网站收录排名最高海外做淘宝网站
  • 建设好网站为什么读取不到文件软件开发工具与平台
  • 橙米网站建设小杨哥直播带货平台
  • 网站首页代码怎么做自动免费设计logo
  • 为什么做网站推广建筑招聘网官网
  • 杭州网站建设seo优化企业信息平台
  • 如皋网站设计滦平县建设局网站
  • qq登录镇江网站seo外包