- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 tensorflow网络
# 导入包import tensorflow as tffrom tensorflow_core.examples.tutorials.mnist import input_datafrom tensorflow.python.framework import graph_utilfrom npu_bridge.npu_init import *# 引入minist数据集mnist = input_data.read_data_sets('MNIST_data', one_hot=True
2022-02-23 16:43:44
764
原创 学习用torch写模型
用torch写一个topk+add的小模型import torchprint(torch.__version__)class Net1(torch.nn.Module): def __init__(self): super(Net1, self).__init__() def forward(self, x): output = torch.topk(x,1000) print("**************",type(outpu
2022-02-10 22:00:33
982
原创 tf的随笔
检测tf是否使用gpuimport numpy as npimport tensorflow as tfversion = tf.__version__gpu_ok = tf.test.is_gpu_available()print("tf version:",version,"\nuse GPU",gpu_ok)
2022-02-10 21:32:17
679
原创 onnx模型中增加算子的修改(已cast为例)
原始模型https://modelzoo-issue.obs.cn-north-4.myhuaweicloud.com/I4Q85F_log28.rar目的在topk算子前插入一个cast算子,使得topk算子的k输入类型从int64转换为int32修改代码import onnxonnx_model = onnx.load("maskrcnn01102.onnx")graph = onnx_model.graphnode = graph.node#搜索TopK_1262节点所在的网络id
2022-02-09 11:26:53
5474
原创 记不住的笔记
np的随机数生成numpy.random.randint(low, high=None, size=None, dtype=‘l’)生成的数据要在[high,low)之间,high默认值为0,size是生成的矩阵的shape,dtypt:数据类型input_array = np.random.randint(1000, size=(32, 10))print(input_array.shape,input_array.dtype)>>>(32, 10) int32input_
2022-01-06 22:58:13
97
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人