tensorflow

Why is the result of the code offered by Deep Learning with TensorFlow different from the snapshot in its book

跟風遠走 提交于 2021-02-19 07:49:05
问题 In the first chapter of Deep Learning with TensorFlow , it gives an example on how to build a simple neural network for recognizing handwritten digits. According to its description, the code bundle for the book can be found at GitHub. From the context, I think section Running a simple TensorFlow 2.0 net and establishing a baseline uses the code same with Deep-Learning-with-TensorFlow-2-and-Keras/mnist_V1.py. When I run this example code, it gives me the following output: The snapshot from the

Reinforcement Learning Using Multiple Stock Ticker’s Datasets?

老子叫甜甜 提交于 2021-02-19 07:49:05
问题 Here’s a general question that maybe someone could point me in the right direction. I’m getting into Reinforcement Learning with Python 3.6/Tensorflow and I have found/tweaked my own model to train on historical data from a particular stock. My question is, is it possible to train this model on more than just one stock’s dataset? Every single machine learning article I’ve read on time series prediction and RL uses one dataset for training and testing, but my goal is to train a model on a

How many epochs does it take to train VGG-16

。_饼干妹妹 提交于 2021-02-19 06:38:04
问题 I'm training a VGG-16 model from scratch using a dataset containing 3k images. I use Tensorflow platform and 8 cpus without any gpu. Training rate - 0.01, Weight decay - 0.0005, Momentum - 0.9, Batch size - 64, I've kept training for about three days. But the training accuracy has been unchanged, around 15%-20% after 20 epochs. Could anyone give me some hints to improve the accuracy? 回答1: It seems like I have used too large learning rate. Or weight decay does not work as it promises. After I

Why are the tensor dimensions as given for convolutional neural networks? - TensorFlow

不想你离开。 提交于 2021-02-19 05:48:04
问题 I am having a bit of trouble understanding the dimensions of the tensors used in the set up of convolutional neural networks using TensorFlow. For example, in this tutorial, the 28x28 MNIST images are represented like this: import TensorFlow as tf x = tf.placeholder(tf.float32, shape=[None, 784]) x_image = tf.reshape(x, [-1,28,28,1]) Assuming I have ten training images, the reshaping above makes my input x_image a collection of ten sub-collections of twenty-eight 28-dimensional column vectors

how to install tensorflow version 1.12.0 with pip

我的梦境 提交于 2021-02-19 05:30:47
问题 I need the specific tensorflow-gpu version 1.12.0 for my application as i have cuda-9 in my system. I am able to find the whl file for tensorflow cpu , but not able to locate the same for tensorflow-gpu. 回答1: You can use: "pip3 install tensorflow-gpu==1.12.0" 来源: https://stackoverflow.com/questions/55877398/how-to-install-tensorflow-version-1-12-0-with-pip

how to install tensorflow version 1.12.0 with pip

不想你离开。 提交于 2021-02-19 05:29:11
问题 I need the specific tensorflow-gpu version 1.12.0 for my application as i have cuda-9 in my system. I am able to find the whl file for tensorflow cpu , but not able to locate the same for tensorflow-gpu. 回答1: You can use: "pip3 install tensorflow-gpu==1.12.0" 来源: https://stackoverflow.com/questions/55877398/how-to-install-tensorflow-version-1-12-0-with-pip

Evaluation of loss with session.run([]) in TensorFlow

自古美人都是妖i 提交于 2021-02-19 05:26:41
问题 For simple gradient descent, I am using this : _, l, predictions = session.run([optimizer, loss, train_prediction]) where optimizer op minimizes loss. But I am feeding loss after optimizer, so will the loss, be evaluated two times at each .run(), one using initial weight, and then using updated weights ? 回答1: The order of elements in the list of fetched tensors doesn't matter (except for capturing the values on the Python side). They will all be executed during the same evaluation. In your

Delayed echo of sin - cannot reproduce Tensorflow result in Keras

早过忘川 提交于 2021-02-19 04:54:20
问题 I am experimenting with LSTMs in Keras with little to no luck. At some moment I decided to scale back to the most basic problems in order finally achieve some positive result. However, even with simplest problems I find that Keras is unable to converge while the implementation of the same problem in Tensorflow gives stable result. I am unwilling to just switch to Tensorflow without understanding why Keras keeps diverging on any problem I attempt. My problem is a many-to-many sequence

How to fix “IndexError: list index out of range” in Tensorflow

半城伤御伤魂 提交于 2021-02-19 04:29:48
问题 I'm creating an Image Classifier using Tensorflow and Keras, but when I tried to train my model I got an error: IndexError: list index out of range. I think the problem is with my model, because when I remove the conv2D layers, then the code throws no error. model = Sequential() model.add(Conv2D(64,(3,3),activation='relu',padding='same')) model.add(Conv2D(64,(3,3),activation='relu',padding='same')) model.add(MaxPool2D((2,2),strides=(2,2))) model.add(Conv2D(128,(3,3),activation='relu',padding=

Tensorflow operations are unsusably slow

你离开我真会死。 提交于 2021-02-19 03:48:46
问题 I'm trying to get started with tensorflow using the python interface. My problem is that executing even the most basic operations, they take a long time (> 5 minutes) This problem occurs when using python3.6, installed from macports and tensorflow-1.13, the tf-nightly, and tensorflow2.0 alpha, all installed using pip. This simple example takes more than 5 minutes to execute. > ipython Python 3.6.8 (default, Dec 30 2018, 13:01:27) In [1]: import numpy as np In [2]: import tensorflow as tf In