1 .在深度学习领域,模式将受到培训。 使用经过训练的模型时,其中有一种保存的模型文件格式:npy。 怎么打开?
2 .将打开实现代码。
importnumpyasnptest=NP.load (‘./bvlc _ Alex net.npy ‘,encoding=’latin1 ‘ ) #加载文件doc=open(‘1.txt ‘,)
importnumpyasnpfromnumpyimport * #使用numpy属性,不需要在前面添加numpyimport tensorflow as tf #模型文件(.npy )的一部分。 由词典组成,词典中的每个键对应一级网络模型参数。 [包括权重w和偏移b ] a={ ‘ con v1 ‘ : [ array ] [ [ 1,2 ],[ 3,4 ],dtype=float32],array ] [ 5,6 ],dtype=FLL
[[ 1. 2.]
[ 3. 4.]]。
TF.variable ‘ variable :0 ‘ shape=(2,2 ) dtype=float32_ref
[ 5. 6.]
TF.variable ‘ variable _ 1:0 ‘ shape=(2,) dtype=float32_ref
原文链接: https://blog.csdn.net/William _ hehe/article/details/80412227