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

自己在百度上可以做网站吗东莞注册营业执照

自己在百度上可以做网站吗,东莞注册营业执照,网上网络推广,网站建设低价网站到底便宜在哪TRT8 一个大版本#xff0c;8.4-、 8.5、 8.6#xff08;包含预览功能#xff09;却有很多变动#xff0c;一不注意就发现很混乱#xff0c;特备注此贴。建议具体case可以参考这个合集#xff0c;真心安利#xff1a;https://github.com/NVIDIA/trt-samples-for-hackath…        TRT8 一个大版本8.4-、 8.5、 8.6包含预览功能却有很多变动一不注意就发现很混乱特备注此贴。建议具体case可以参考这个合集真心安利https://github.com/NVIDIA/trt-samples-for-hackathon-cn/tree/master/cookbook 版本差异概述 1当前使用了8.4 参考 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/01-SimpleDemo/TensorRT8.0/main-cuda.py 28.5版本废弃了binding, 导致开内存代码不同 参考 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/01-SimpleDemo/TensorRT8.5/main.py 38.6版本以后支持dynamic shape统一个profile 用于不同的context。不再支持Pascal P40但完全改变了原来TRT engine必须绑定硬件和版本的要求 现在可以解耦出来但是有如下限制 1、binding 改变 18.5前需要使用biding 接口 对应dynamic batch 多个profile 需要计算偏置。偏置或者说index 是针对profile 同一个engine的不是针对context的。下图是一个engine里有3个profile模型有4个输入1个输出那么就有41*3 15个binding。 engine.num_bindings 获取binding 总数 engine.binding_is_input 计算出input数量每个profile里 算一个 engine.binding_is_inpu // nProfile 才是模型的输入个数 context.set_binding_shape 设置输入输出的维度如上面表格需要计算出pad和对应输入输出的顺序index contex.get_binding_shape 获得对应profile 的输出的维度 context.execute_async_v2 执行推理这里传入的第一个参数为输出输出GPU显存的地址并且需要填满如上的表格不用的位置填0。 完整代码 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiOptimizationProfile/main-BindingAPI.py logger trt.Logger(trt.Logger.ERROR) engine trt.Runtime(logger).deserialize_cuda_engine(engineString) # engineString 是二进制 open engine文件 nIO engine.num_bindings nInput np.sum([engine.binding_is_input(i) for i in range(engine.num_bindings)]) nOutput nIO - nInput nIO, nInput, nOutput nIO // nProfile, nInput // nProfile, nOutput // nProfile context engine.create_execution_context() context.set_optimization_profile_async(index, stream) bindingPad nIO * index_profile  # 计算binding 的偏置 context.set_binding_shape(bindingPad 0, inputShape) # 第一个输入 outputShape contex.get_binding_shape(bindingPad nInput 0) # 第一个输出 bufferList [int(0) for b in bufferD[:bindingPad]] \[int(b) for b in bufferD[bindingPad:(bindingPad nInput nOutput)]] \[int(0) for b in bufferD[(bindingPad nInput nOutput):]] context.execute_async_v2(bufferList, stream) 28.5 之后废弃binding 使用范例如下 engine.num_io_tensors  获取输入输出总个数 engine.get_tensor_name  获得对应的输入输出名字 engine.get_tensor_mode 判断是输入还是输出trt.TensorIOMode.INPUT 、trt.TensorIOMode.OUTPUT context.set_input_shape 直接设置对应的形状不再需要计算偏置 context.get_tensor_shape 直接获得输入输出需要先设置输入自动计算形状 context.set_tensor_address 绑定TRT 输入输出和 开辟的显存 context.execute_async_v3 来执行推理 完整代码 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiOptimizationProfile/main.py logger trt.Logger(trt.Logger.ERROR) engine trt.Runtime(logger).deserialize_cuda_engine(engineString) # engineString 是二进制 open engine文件 nIO engine.num_io_tensors lTensorName [engine.get_tensor_name(i) for i in range(nIO)] nInput [engine.get_tensor_mode(lTensorName[i]) for i in range(nIO)].count(trt.TensorIOMode.INPUT) context engine.create_execution_context() context.set_optimization_profile_async(index, stream) context.set_input_shape(lTensorName[0], inputShape) outputShape context.get_tensor_shape(lTensorName[1]) context.set_tensor_address(lTensorName[0], int(cudart.cudaMalloc(nbytes)[1])) context.execute_async_v3(0) 2、dynamic shape 性能 如果跨度较大建议使用多个配置文件可以明显提升推理性能 参考 Developer Guide :: NVIDIA Deep Learning TensorRT Documentation https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/09-BestPractice/UsingMultiOptimizationProfile/result-A30.md https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/09-BestPractice/UsingMultiOptimizationProfile/main.py 获得真实推理形状假设真实为3150150要使用 context.get_tensor_shape(0) 返回 (3, 150, 250)而不是 engine.get_tensor_shape(foo”)  返回  (3, -1, -1)  。 3、engine、 context、stream、profile动态batch的配置文件 一个engine 可以拥有多个context共享一个权重。 可以将不同的context 放到不同的stream 中实现并行。 一个context可以拥有多个profile至少一个但是8.6 0805预览特性前一个profile 只能绑定一个contextcontext 和profile 需要错开使用。 参考 多流8.6 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiStream/main.py 多上下文-动态batch8.6 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiContext/main.py  多上下文-动态batch8.5- https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiContext/main-MultiOptimizationProfile.py
http://www.yutouwan.com/news/59052/

相关文章:

  • 叫企业做的网站可不可以自己改主题宝塔面板WordPress优化
  • 推荐广州微信网站建设天津公司网站建设公司哪家好
  • 速成网站建设seo代理计费系统
  • 唯拓网站建设房屋设计装修app
  • vs2010c 做网站网站开发 验收移交
  • 自助建立网站网站建设开发人员须知
  • 网站专题报道页面怎么做的快站wordpress
  • 设计师网站兼职ai智能写作平台
  • 网站右键屏蔽网站开发包含网页设计吗
  • 河南省住房和城乡建设厅新网站怎么建立简单网站
  • 静安网站建设哪里有国际军事新闻报道
  • 域名费用和网站服务器费用是同样的吗合肥瑶海区医院
  • 网站原创内容优化能联系做仿瓷的网站
  • 海安网站优化wordpress商城主题手机版
  • 济南网站制作 泉诺黄骅港中铁招聘信息
  • 怎么把网站模板上传到自己的网站seo比较好的公司
  • 一个网站做多访问量自己做网站卖视频
  • 嘉兴哪里可以做淘宝网站wordpress自动更新发布
  • 网络一站式服务平台供求信息平台
  • 开发个网站多少钱郑州seo顾问外包
  • 建站行业该网站尚未备案 腾讯云
  • 成都专业网站设计免费咨询株洲网站搜索优化
  • 南阳做网站优化价格博客可以做seo吗
  • 登录门户网站网站优化新闻
  • 网站是如何盈利后台查看网站容量
  • 旅游网站建设技术有哪些内容上海中小企业服务中心官网
  • 阿里云网站开发微信app下载安装官方版2020
  • 后台做网站的题行业网站怎么推广
  • 武夷山景区网站建设特点东营最新通知今天重要消息
  • 前端如何做响应式网站可以做问卷调查的网站