tensorflow

Keras failed to load SavedModel: TypeError 'module' object is not callable

僤鯓⒐⒋嵵緔 提交于 2021-01-07 01:17:13
问题 I trained an SSD MobileNet v2 network using the TensorFlow Object Detection API with TensorFlow 2 and then converted the trained model into a SavedModel. Now I need to convert the SavedModel to a FrozenGraph in order to make the model compatible with external libraries like OpenCV. I use this example for conversion and I cannot even load the Keras model. from keras.models import load_model model = load_model("training/model/saved_model") Calling load_model() produces an exception: Exception

Keras failed to load SavedModel: TypeError 'module' object is not callable

怎甘沉沦 提交于 2021-01-07 01:16:22
问题 I trained an SSD MobileNet v2 network using the TensorFlow Object Detection API with TensorFlow 2 and then converted the trained model into a SavedModel. Now I need to convert the SavedModel to a FrozenGraph in order to make the model compatible with external libraries like OpenCV. I use this example for conversion and I cannot even load the Keras model. from keras.models import load_model model = load_model("training/model/saved_model") Calling load_model() produces an exception: Exception

Reshape and write ImageDataGenerator output to CSV file

Deadly 提交于 2021-01-07 01:07:08
问题 I'm working with the MNIST data set. I have the training data vectors in one CSV file (i.e. 60,000 rows, each with 784 columns), and the labels in a separate CSV file. I want to bulk up the amount of training data, and append it to the CSV. It has to be done like this, because then the CSV file has to be fed in to a separate pipeline. I originally wrote this script: import keras from keras.preprocessing.image import ImageDataGenerator import pandas as pd X_train = pd.read_csv('train-images

Reshape and write ImageDataGenerator output to CSV file

跟風遠走 提交于 2021-01-07 01:05:55
问题 I'm working with the MNIST data set. I have the training data vectors in one CSV file (i.e. 60,000 rows, each with 784 columns), and the labels in a separate CSV file. I want to bulk up the amount of training data, and append it to the CSV. It has to be done like this, because then the CSV file has to be fed in to a separate pipeline. I originally wrote this script: import keras from keras.preprocessing.image import ImageDataGenerator import pandas as pd X_train = pd.read_csv('train-images

使用OpenCV+Tensorflow跟踪排球的轨迹

霸气de小男生 提交于 2021-01-06 12:41:27
介绍 本文将带领大家如何把人工智能技术带到体育项目中。 运动中的人工智能是一个很新的东西,以下是一些有趣的作品: 篮球 https://dev.to/stephan007/open-source-sports-video-analysis-using-maching-learning-2ag4 网球 https://www.researchgate.net/publication/329740964_Convolutional_Neural_Networks_Based_Ball_Detection_in_Tennis_Games 排球 https://www.tugraz.at/institute/icg/research/team-bischof/lrs/downloads/vb14/ 我是个排球迷,所以让我们来看看最后一个网站,这是一个奥地利研究所的网站,他分析了当地业余联赛的比赛数据。 其中有一些文档需要阅读,最主要的信息是视频数据集。 排球是一项复杂的运动,有许多不同的因素,所以我从一个很小但很重要的部分开始——球。 跟踪球是一项非常著名的任务。谷歌提供了很多链接,但其中有许多只是一个简单的演示。在摄像机前识别和跟踪一个彩色的大球是无法与真实的比赛用球检测相比较的,因为现实世界中的球很小,移动速度很快,而且融入了背景中。 最后,我们希望得到这样的结果: 在开始之前

基于yolov3和pythorch框架的火焰识别检测算法

我是研究僧i 提交于 2021-01-06 09:37:18
这是本人第一次写博客,就当是自己实现算法的一个记录吧,有什么不好的地方也请多多指教。我会详细的从环境的配置到算法实现都说明一下,希望对大家能有帮助。 本火焰识别算法采用的是pytorch版本的yolov3检测,yolov3基于Darknet-53网络结构,在图像识别领域应用特别广。 本算法识别的效果如下: 下面开始实际操作啦 一、配置环境 算法所需环境如下: Python: 3.7.4 Tensorflow-GPU 1.14.0 Keras: 2.2.4 numpy:1.17.4 我的操作系统是Ubuntu16.04,windows系统同样可以实现此算法这里建议使用anaconda来快速搭建一个虚拟环境。 如果是ubuntu系统可以参考这篇博客安装anaconda,Anaconda 是 Python 的一个出色的集成开发工具集,对于搞深度学习的人来说应该是必备的。 ubuntu安装anaconda链接 有了anaconda后就可以用它创建虚拟环境啦。具体可以参考这篇博客。 anaconda创建虚拟环境 之后安装Tensorflow,由于我的显卡是AMD的,所以安装的CPU版的,大家可以根据自己的显卡安装相应版本。运行下面的命令安装Tensorflow。 pip install tensorflow==1.14.0 下一步安装相应版本的Keras,运行下面的命令。 pip

Tensorflow: Is it possible to store TF record sequence examples as float16

喜你入骨 提交于 2021-01-06 07:27:45
问题 Is it possible to store sequence example in tensorflow as float16 instead of regular float? We can live with 16bit precision, and it will reduce the size of the data files we use, saving us ~200 GB. 回答1: I think the snip below does just that. import tensorflow as tf import numpy as np # generate the data data_np = np.array(np.random.rand(10), dtype=np.float16) with tf.python_io.TFRecordWriter('/tmp/data.tfrecord') as writer: # encode the data in a dictionary of features data = {'raw': tf

Tensorflow: Is it possible to store TF record sequence examples as float16

一曲冷凌霜 提交于 2021-01-06 07:22:28
问题 Is it possible to store sequence example in tensorflow as float16 instead of regular float? We can live with 16bit precision, and it will reduce the size of the data files we use, saving us ~200 GB. 回答1: I think the snip below does just that. import tensorflow as tf import numpy as np # generate the data data_np = np.array(np.random.rand(10), dtype=np.float16) with tf.python_io.TFRecordWriter('/tmp/data.tfrecord') as writer: # encode the data in a dictionary of features data = {'raw': tf

Tensorflow: Is it possible to store TF record sequence examples as float16

我是研究僧i 提交于 2021-01-06 07:22:22
问题 Is it possible to store sequence example in tensorflow as float16 instead of regular float? We can live with 16bit precision, and it will reduce the size of the data files we use, saving us ~200 GB. 回答1: I think the snip below does just that. import tensorflow as tf import numpy as np # generate the data data_np = np.array(np.random.rand(10), dtype=np.float16) with tf.python_io.TFRecordWriter('/tmp/data.tfrecord') as writer: # encode the data in a dictionary of features data = {'raw': tf

Understanding Bahdanau's Attention Linear Algebra

冷暖自知 提交于 2021-01-06 03:25:57
问题 Bahdanau's Additive Attention is recognized as the second part of equation 4 in the below image. I am trying to figure out the shapes of the matrices w1 , w2 , ht , hs and v in order to figure out how this mechanism is used in this paper Can ht and hs have different final dimensions? say (batch size, total units) and (batch size, time window). Equation 8 in the mentioned paper above seem to be doing this. Equation 8 in the above paper has the below notation: what does this expand to exactly?