国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

DAPP/FDF智能合約眾籌循環(huán)互助系統(tǒng)開發(fā)(詳細(xì)方案)丨源碼部署

2023-03-21 15:58 作者:bili_33032327742  | 我要投稿

  作為一種可能的Web3.0底層技術(shù),區(qū)塊鏈以去中心化、不可篡改、可溯源等特點,構(gòu)建起數(shù)字經(jīng)濟時代的全新信任體系。


  從技術(shù)角度分析,區(qū)塊鏈讓數(shù)字資產(chǎn)價值流轉(zhuǎn)的每一個節(jié)點都公開透明、有跡可循且不可篡改,這將會讓W(xué)eb3.0時代的一切交易變得更加真實可信。


  同時,數(shù)據(jù)通過區(qū)塊鏈技術(shù)可以確定權(quán)屬,實現(xiàn)數(shù)據(jù)的資產(chǎn)化,這也將使得區(qū)塊鏈成為Web3.0時代的基礎(chǔ)設(shè)施。


  一、pytorch模型保存/加載


  有兩種方式可用于保存/加載pytorch模型1)文件中保存模型結(jié)構(gòu)和權(quán)重參數(shù)2)文件只保留模型權(quán)重.


  1、文件中保存模型結(jié)構(gòu)和權(quán)重參數(shù)


  1)pytorch模型保存


  import torch


  torch.save(selfmodel,"save.pt")


  2)pytorch模型加載


  import torch


  torch.load("save.pt")


  2、文件只保留模型權(quán)重


  1)pytorch模型保存


  import torch


  torch.save(selfmodel.state_dict(),"save.pt")


  2)pytorch模型加載


  關(guān)于區(qū)塊鏈技術(shù)項目開發(fā)威:yy625019


  selfmodel.load_state_dict(torch.load("save.pt"))


  二、pytorch模型轉(zhuǎn)ONNX模型


  1、文件中保存模型結(jié)構(gòu)和權(quán)重參數(shù)


  import torch


  torch_model=torch.load("save.pt")#pytorch模型加載


  batch_size=1#批處理大小


  input_shape=(3,244,244)#輸入數(shù)據(jù)


  #set the model to inference mode


  torch_model.eval()


  x=torch.randn(batch_size,*input_shape)#生成張量


  export_onnx_file="test.onnx"#目的ONNX文件名


  torch.onnx.export(torch_model,


  x,


  export_onnx_file,


  opset_version=10,


  do_constant_folding=True,#是否執(zhí)行常量折疊優(yōu)化


  input_names=["input"],#輸入名


  output_names=["output"],#輸出名


  dynamic_axes={"input":{0:"batch_size"},#批處理變量


  "output":{0:"batch_size"}})


  注:dynamic_axes字段用于批處理.若不想支持批處理或固定批處理大小,移除dynamic_axes字段即可.


  2、文件中只保留模型權(quán)重


  import torch


  torch_model=selfmodel()#由研究員提供python.py文件


  batch_size=1#批處理大小


  input_shape=(3,244,244)#輸入數(shù)據(jù)


  #set the model to inference mode


  torch_model.eval()


  x=torch.randn(batch_size,*input_shape)#生成張量


  export_onnx_file="test.onnx"#目的ONNX文件名


  torch.onnx.export(torch_model,


  x,


  export_onnx_file,


  opset_version=10,


  do_constant_folding=True,#是否執(zhí)行常量折疊優(yōu)化


  input_names=["input"],#輸入名


  output_names=["output"],#輸出名


  dynamic_axes={"input":{0:"batch_size"},#批處理變量


  "output":{0:"batch_size"}})


DAPP/FDF智能合約眾籌循環(huán)互助系統(tǒng)開發(fā)(詳細(xì)方案)丨源碼部署的評論 (共 條)

分享到微博請遵守國家法律
全椒县| 龙岩市| 湘阴县| 岗巴县| 阳新县| 洞口县| 正宁县| 南木林县| 白水县| 长垣县| 定陶县| 资溪县| 石狮市| 东台市| 陈巴尔虎旗| 云安县| 广水市| 余姚市| 江源县| 文化| 雷波县| 平原县| 绍兴县| 沭阳县| 昌吉市| 尼玛县| 娱乐| 上林县| 烟台市| 麻江县| 东宁县| 定结县| 蕲春县| 光泽县| 宽城| 宁远县| 威海市| 开阳县| 嘉峪关市| 元朗区| 壤塘县|