tensorflow

Unsupported return value from function passed to Dataset.map()

戏子无情 提交于 2021-01-28 05:20:37
问题 i am trying to preprocess and classify iris dataset using tensorflow piplines, but after the preprocessing i've got this error: Unsupported return value from function passed to Dataset.map(): (, NumericColumn(key='features', shape=(4,), default_value=None, dtype=tf.float32, normalizer_fn=None)) , i am stuck un there, il'll be happy for any helpe here's the complete code of the DNN import tensorflow_datasets as tfds from tensorflow.keras.optimizers import Adam data = tfds.load("iris", split

Keras LSTM: Return Empty Array on Predicition

喜夏-厌秋 提交于 2021-01-28 05:20:31
问题 I am trying to write my first LSTM with Keras and i'm stucking. That are my training data structure: x_data = [1265, 12] y_data = [1265, 3] x_data example: [102.7, 100.69, 103.39, 99.6, 319037.0, 365230.0, 1767412, 102.86, 13.98] y_data example: [0, 0, 1] My model looks like the following: self._opt_cells = 12 self.model = Sequential() self.model.add(LSTM(units = self._opt_cells, return_sequences = True, input_shape = (12, 1))) self.model.add(Dropout(0.2)) self.model.add(LSTM(units = self.

How can I convert yolo weights to tflite file

不羁的心 提交于 2021-01-28 05:19:27
问题 I will use yolo weights in android so I plan to convert yolo weights file to tflite file. I use this code in anaconda prompt because I downloaded keras library in env. activate env python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5 Finally, it did.Saved Keras model to model_data/yolo.h5 And I'm going to convert this h5 file to tflite file in jupyter notebook with this code. model = tf.keras.models.load_model("./yolo/yolo.h5", compile=False) converter = tf.lite.TFLiteConverter.from

Add learning rate to history object of fit_generator with Tensorflow

三世轮回 提交于 2021-01-28 05:13:46
问题 I want to check how my optimizer is changing my learning rate. I am using tensorflow 1.15. I run my model with fit_generator: hist = model.fit_generator(dat, args.onthefly[0]//args.batch, args.epochs, validation_data=val, validation_steps=args.onthefly[1]//args.batch,verbose=2, use_multiprocessing=True, workers=56) I choose the optimizer using the compile function: model.compile(loss=loss, optimizer=Nadam(lr=learning_rate), metrics=['binary_accuracy'] ) How can I get the value of the learning

大型分布式存储方案MinIO介绍,看完你就懂了!

。_饼干妹妹 提交于 2021-01-28 05:12:31
1、MinIO是什么? 官方解释:MinIO 是一个基于Apache License v2.0开源协议的对象存储服务。它兼容亚马逊S3云存储服务接口,非常适合于存储大容量非结构化的数据,例如图片、视频、日志文件、备份数据和容器/虚拟机镜像等,而一个对象文件可以是任意大小,从几kb到最大5T不等。 MinIO是一个非常轻量的服务,可以很简单的和其他应用的结合,类似 NodeJS, Redis 或者 MySQL。 2、MinIO有哪些优势? 2.1 开发文档全面 MinIO作为一款基于Golang 编程语言开发的一款高性能的分布式式存储方案的开源项目,有十分完善的官方文档。。 官网文档地址:https://docs.min.io/cn/ 2.2 高性能 MinIO号称是目前速度最快的对象存储服务器。在标准硬件上,对象存储的读/写速度最高可以高达183 GB/s和171 GB/s。对象存储可以作为主存储层,用来处理Spark、Presto、TensorFlow、H2O.ai等各种复杂工作负载以及成为Hadoop HDFS的替代品。 MinIO用作云原生应用程序的主要存储,和传统对象存储相比,云原生应用程序需要更高的吞吐量和更低的延迟。而这些都是MinIO能够达成的性能指标。 2.3 支持全面 目前MinIO支持市面主流的开发语言并且可以通过SDK快速集成快速集成使用。 2.4 AWS

How can tensorflow do basic math with integer data larger than 32 bits?

橙三吉。 提交于 2021-01-28 05:11:54
问题 What's the best way to do simple math using int64, BigInt or even float64 values with tensors? I mention that I want to do simple math to say that I don't think that backing the tensor with a String will do the trick (though I'm open to anything at this point). By simple math, I mean add, subtract, multiply, divide and compare. I'm a tensorflow newbie, using version 1.1.2 of tensorflow for javascript in Chrome. Here's an example of Math.PI yielding an incorrect tensor value: Math.PI; // 3

Deep Learning with Python code no longer working. “TypeError: An op outside of the function building code is being passed a ”Graph“ tensor.”

别说谁变了你拦得住时间么 提交于 2021-01-28 05:11:08
问题 I'm implementing a Tensorflow Variational Autoencoder, copying the code exactly from the book "Deep Learning with Python". Up until a few days ago, the code was working perfectly but as of yesterday it has stopped working (I have not changed the code). The code is for a generative model which can replicate images from the MNIST dataset. The specific error message is below: TypeError: An op outside of the function building code is being passed a "Graph" tensor. It is possible to have Graph

How does tf.sign work with back propagation?

做~自己de王妃 提交于 2021-01-28 04:43:45
问题 I'm starting with TensorFlow, and I am trying to create a binary network. More specifically, I'm looking for a hashing network that would encode an image in a binary vector of size n. So I have a classic network, and I binarize the last layer before softmax. TensorFlow provides a tf.sign function that can do just that, but I can't figure out how the back-propagation can work in practice, since it's not continuous. Any thoughts ? 回答1: Unfortunately tf.sign() 's gradient is always defined as 0

ai-platform: No eval folder or export folder in outputs when running TensorFlow 2.1 training job using Estimators

≯℡__Kan透↙ 提交于 2021-01-28 03:38:54
问题 The Problem My code works locally, but I am not able to get any evaluation data or exports from my TensorFlow estimator when submitting online training jobs after having upgraded to TensorFlow 2.1. Here's the bulk of my code: def build_estimator(model_dir, config): return tf.estimator.LinearClassifier( feature_columns=feature_columns, n_classes=2, optimizer=tf.keras.optimizers.Ftrl( learning_rate=args.learning_rate, l1_regularization_strength=args.l1_strength ), model_dir=model_dir, config

Out of memory OOM using tensorflow gradient tape but only happens when I append a list

你。 提交于 2021-01-28 03:21:57
问题 I've been working on a data set (1000,3253) using a CNN. I'm running gradient calculations through gradient tape but it keeps running out of memory. Yet if I remove the line appending a gradient calculation to a list the script runs through all the epochs. I'm not entirely sure why this would happen but I am also new to tensorflow and the use of gradient tape. Any advice or input would be appreciated #create a batch loop for x, y_true in train_dataset: #create a tape to record actions with tf