keras

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray). in trying to predict tesla stock

♀尐吖头ヾ 提交于 2020-12-11 08:51:23
问题 In the end you can see that i have tried converting this into a numpy array but I don't understand why tensorflow dosen't support it? I have looked at the other related pages but none seemed to help. Is there some other format i have to do to the data in order to properly fit in model? this is what keras says: x Vector, matrix, or array of training data (or list if the model has multiple inputs). If all inputs in the model are named, you can also pass a list mapping input names to data. x can

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray). in trying to predict tesla stock

左心房为你撑大大i 提交于 2020-12-11 08:47:04
问题 In the end you can see that i have tried converting this into a numpy array but I don't understand why tensorflow dosen't support it? I have looked at the other related pages but none seemed to help. Is there some other format i have to do to the data in order to properly fit in model? this is what keras says: x Vector, matrix, or array of training data (or list if the model has multiple inputs). If all inputs in the model are named, you can also pass a list mapping input names to data. x can

'Dense' object has no attribute 'op'

落爺英雄遲暮 提交于 2020-12-08 06:11:37
问题 I am trying to make a fully connected model using tensorflow.keras, here is my code from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Dense, Flatten def load_model(input_shape): input = Input(shape = input_shape) dense_shape = input_shape[0] x = Flatten()(input) x = Dense(dense_shape, activation='relu')(x) x = Dense(dense_shape, activation='relu')(x) x = Dense(dense_shape, activation='relu')(x) x = Dense(dense_shape, activation='relu')(x) x = Dense(dense

tensorflow gpu is only running on CPU

柔情痞子 提交于 2020-12-07 07:17:43
问题 I installed Anaconda-Navigatoron Windows 10 and all necessary Nvidia/Cuda packages, created a new environment called tensorflow-gpu-env, updated PATH information, etc. When I run a model (build by using tensorflow.keras ), I see that CPU utilization increases significantly, GPU utilization is 0%, and the model just does not train. I run a couple of tests to make sure how things look: print(tf.test.is_built_with_cuda()) True The above output ('True') looks correct. Another try: from tensorflow

tensorflow gpu is only running on CPU

ⅰ亾dé卋堺 提交于 2020-12-07 07:17:20
问题 I installed Anaconda-Navigatoron Windows 10 and all necessary Nvidia/Cuda packages, created a new environment called tensorflow-gpu-env, updated PATH information, etc. When I run a model (build by using tensorflow.keras ), I see that CPU utilization increases significantly, GPU utilization is 0%, and the model just does not train. I run a couple of tests to make sure how things look: print(tf.test.is_built_with_cuda()) True The above output ('True') looks correct. Another try: from tensorflow

tensorflow gpu is only running on CPU

雨燕双飞 提交于 2020-12-07 07:17:13
问题 I installed Anaconda-Navigatoron Windows 10 and all necessary Nvidia/Cuda packages, created a new environment called tensorflow-gpu-env, updated PATH information, etc. When I run a model (build by using tensorflow.keras ), I see that CPU utilization increases significantly, GPU utilization is 0%, and the model just does not train. I run a couple of tests to make sure how things look: print(tf.test.is_built_with_cuda()) True The above output ('True') looks correct. Another try: from tensorflow

Tensorflow 2.0 InvalidArgumentError: assertion failed: [Condition x == y did not hold element-wise:]

我们两清 提交于 2020-12-06 12:20:24
问题 i am training a mnist CNN. When i ran my code the problem is coming . I tried other answers but they do not work. I am a new to TensorFlow so can someone explain me this error. Here is my code. i am using Pycharm 2020.2. and Python 3.6 in anaconda. There is no help i could find. import tensorflow as tf from tensorflow.keras.models import Sequential mnist = tf.keras.datasets.mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = tf.keras.utils.normalize(x_train, axis=1) x

How to feed multiple NumPy arrays to a deep learning network in Keras?

只愿长相守 提交于 2020-12-06 06:36:35
问题 I have around 13 NumPy arrays stored as files that take around 24 gigabytes on disk. Each file is for a single subject and consists of two arrays: one containing input data (a list of 2D matrices, rows represent sequential time), and the other one containing labels of the data. My final goal is to feed all the data to a deep learning network I've written in Keras to classify new data. But I don't know how to do it without running out of memory. I've read about Keras's data generators, but

深度学习“四大名著”发布!Python、TensorFlow、机器学习、深度学习四件套(附免费下载)

情到浓时终转凉″ 提交于 2020-12-06 05:46:20
Python 程序员深度学习的“四大名著”: 这四本书着实很不错!我们都知道现在机器学习、深度学习的资料太多了,面对海量资源,往往陷入到“无从下手”的困惑出境。而且并非所有的书籍都是优质资源,浪费大量的时间是得不偿失的。给大家推荐这几本好书并做简单介绍。 获得方式: 1.扫码关注 “涛哥聊python” 公众号 2.后台回复关键词: 4books 注: 此处建议复制,不然容易打错 ▲长按扫描关注,回复 4books 即可获取 1. 《Deep Learning with Python》 推荐指数:★★★★☆ 本书自出版以来收到众多好评,因为是 Keras 作者写的书,所以全书基本围绕着 Keras 讲深度学习的各种实现,从 CNN,RNN 到 GAN 等,偏入门,但也承载着很多作者对深度学习整体性的思考。这是一本偏实战的书,教你使用 Keras 快速实现深度学习经典项目。看完这本书,基本能对 Keras 和深度学习实战有比较初步的掌握了。 本书源码 GitHub 地址: https://github.com/fchollet/deep-learning-with-python-notebooks 2. 《Python Machine Learning》 推荐指数:★★★☆☆ 本书使用了 Scikit-Learn 和 TensorFlow,分别讲解机器学习和深度学习

How to enforce monotonicity for (regression) model outputs in Keras?

半世苍凉 提交于 2020-12-06 02:40:29
问题 I am currently working on a problem where I provide a neural network with an input variable a , and another input x which is a monotonically increasing sequence of N numbers. So my network would basically looks something like this: a_input = Input(shape=[1], name='a') x_input = Input(shape=[N], name='x') nn = concatenate([a_input, x_input]) nn = Dense(100, activation='relu')(nn) nn = Dense(N, activation='relu')(nn) model = Model(inputs=[a_input, x_input], outputs=[nn]) model.compile(loss=