![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow
哗啦呼啦嘿
这个作者很懒,什么都没留下…
展开
-
Error-onnxruntime.capi.onnxruntime_pybind11_state.Fail:
转换之后运行onnx文件就报错:解决:最好把h5模型重新加载一下,保存save_model文件: 转pb:转onnx的时候使用的是save_model格式:原创 2023-11-15 16:02:26 · 1360 阅读 · 0 评论 -
Error- Loaded runtime CuDNN library: 8.0.4 but source was compiled with: 8.1.0.
更新完成之后,重新训练,没有报错了!原创 2023-10-18 13:17:51 · 1499 阅读 · 0 评论 -
Error-InvalidArgumentError: sequence_length(0) <= 80
这里的input_len一般设置成模型输出的特征图的时间序列长度,比如模型输出[None, 80, 94]) ,[Batch,seq_len,classes],而80就是seq_len,当然这个一般是根据图像的长度来设置,这个应该和数据集中设置的input_len一致。原创 2023-04-21 15:00:40 · 805 阅读 · 1 评论 -
tensorflow2-savedmodel convert to tflite
在tensorflow2中对savedmodel文件夹下文件转换成tflite转载 2022-06-21 14:06:04 · 362 阅读 · 0 评论 -
tensorflow2-savedmodel convert to pb(frozen_graph)
tensorflow2中对savedmodel文件夹下保存的文件进行frozen_graph原创 2022-06-21 13:57:09 · 1362 阅读 · 1 评论 -
Error-tf.function-decorated function tried to create variables on non-first call
在tensorflow2中如下保存模型的总是报错: tf.function-decorated function tried to create variables on non-first call .最终找到原因,需要先在__init__函数体中定义好,才能在call中进行调用.原创 2022-06-17 17:33:14 · 786 阅读 · 0 评论 -
语义分割(Semantic Segmentation)方法
翻译来自:https://gist.github.com/khanhnamle1994/e2ff59ddca93c0205ac4e566d40b5e88语义分割方面的资源:https://github.com/mrgloom/awesome-semantic-segmentation1. 什么是语义分割语义分割是当今计算机视觉领域的关键问题之一。从宏观上看,语义分割是一项高层次的任务,...原创 2019-01-02 18:04:09 · 180291 阅读 · 18 评论 -
Tensorflow-加载权重过滤不需要的变量(选择性加载)
sess = tf.Session()init = tf.global_variables_initializer()sess.run(init)saver = tf.train.Saver()if not args.model_path == '': # saver.restore(sess, args.model_path) ################ 删除不同类别的变量 ################ # var = tf.global_variables() .原创 2021-08-02 17:04:52 · 620 阅读 · 0 评论 -
Tensorflow2(keras)-图像预处理操作(tf.EagerTensor和tf.Tensor)
在tensorflow.keras训练中,如果需要对图像进行预处理操作(数据增强操作),发现很多opencv方法用不了,不能对图像进行直接处理,就会报错:NotImplementedError: Cannot convert a symbolic Tensor to a numpy array所以需要单独加载预处理方法,tf.py_function(aug_image_func, [image], tf.float32),将处理操作放到aug_image_func中,就可以直接image.nu...原创 2021-07-27 17:19:34 · 1957 阅读 · 1 评论 -
Error-Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to
报错:Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to prepro原创 2021-06-11 10:58:13 · 4875 阅读 · 3 评论 -
tensorflow-keras感知量化
1.首先安装tensorflow_model_optimizationpip install tensorflow_model_optimization 2.其次代码中添加两句即可:import tensorflow_model_optimization as tfmotmodel=build_model(image_height=args.image_height, image_width=args.image_width, channels=args.channels,nb_b...原创 2021-05-12 20:34:08 · 1038 阅读 · 0 评论 -
tensroflow-keras下tensorboard以及界面打印学习率
'''参考stackoverflow:https://stackoverflow.com/questions/49127214/keras-how-to-output-learning-rate-onto-tensorboard'''############# 添加部分 ###############class LearningRateLogger(tf.keras.callbacks.Callback): def __init__(self): super().__i.原创 2021-05-12 19:57:17 · 1023 阅读 · 0 评论 -
tensorflow-输出pb模型的所有节点
from tensorflow.python.framework import tensor_utilfrom google.protobuf import text_formatimport tensorflow as tf#如果是tf2的话:import tensorflow.compat.v1 as tffrom tensorflow.python.platform import gfilefrom tensorflow.python.framework import tensor_uti.原创 2021-05-11 13:38:09 · 865 阅读 · 0 评论 -
tensorflow-模型训练后tflite量化(tensorflow1.15)
1.方式一:converter.post_training_quantize=Truedef convert_model_qtv1(): converter = tf.lite.TFLiteConverter.from_frozen_graph('model_convert/ckpt_new/densenet_ocr.pb', input_arrays=["Placeholder"], ..原创 2021-04-16 14:11:50 · 1409 阅读 · 1 评论 -
tensorflow-ckpt转pb
from __future__ import division, print_functionimport osimport sysimport tensorflow as tfimport numpy as npfrom utils.nms_utils import gpu_nmsfrom model import yolov3from utils.misc_utils import parse_anchors, load_weightsfrom utils.data_aug impo.原创 2020-09-24 18:03:44 · 217 阅读 · 0 评论 -
tensorflow-tensorboard打印网络结构
from __future__ import division, print_functionimport tensorflow as tfimport numpy as npimport argparseimport cv2import osos.environ['CUDA_VISIBLE_DEVICES'] = "7"from utils.misc_utils import parse_anchors, read_class_namesfrom utils.nms_utils imp.原创 2020-09-24 17:47:50 · 1754 阅读 · 0 评论 -
Error-No module named ‘tf_slim‘
Error:No module named 'tf_slim'跳转到/models/research/slim下安装:python setup.py install说明安装成功!原创 2020-09-14 09:12:16 · 8635 阅读 · 3 评论 -
pytorch 和 tensorflow-gpu 安装
安装tensorflow-gpu:pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==2.0.0测试(注意:版本不同,有一些细微差别):原创 2020-03-22 22:38:07 · 390 阅读 · 0 评论 -
Error-module 'tensorflow' has no attribute 'GraphDef' 'Session'
tensorflow 2.0.0Error: module 'tensorflow' has no attribute 'GraphDef'graph_def = tf.GraphDef.FromString(file_handle.read())graph_def = tf.compat.v1.GraphDef.FromString(file_handle.read())...原创 2020-03-23 12:12:33 · 11656 阅读 · 2 评论