tensorflow

Get the loss that a given optimizer is minimizing in Tensorflow

冷暖自知 提交于 2021-02-07 14:49:42
问题 I am working in a unit test system for my tensorflow workspace and I would like to know if there is any method or attribute, given a graph with an optimizer operation (after calling .minimize()), to obtain the final loss tensor that it is optimizing and the variables that it controls. For example if I call train_op = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy) I would like to retrieve cross_entropy only having access to train_op. I have access to the train_op object, I only want to

How to experiment with custom 2d-convolution kernels in Keras?

微笑、不失礼 提交于 2021-02-07 14:33:25
问题 In a default Conv2D layer with kernel_size=3 the weights of a slice of one of the filters could be named like this: A B C D E F G H I With kernel_size=5 like this: A B C D E F G H I J K L M N O P Q R S T U V W X Y Now I'd like to build (and train/test) a model based on conv layers with kernels like that: A A B C C A A B C C D D E F F G G H I I G G H I I How could the implementation of such a custom layer look like? 回答1: Maybe like this? class CustomConv2D(Layer): def __init__(self, filters, *

Tensorflow compilation on Odroid XU4

廉价感情. 提交于 2021-02-07 13:24:33
问题 I am trying to compile Tensorflow (tried both: full & lite) on Odroid XU4 (16GB eMMc, Ubuntu 16) but I am getting errors shown in figures: https://www.dropbox.com/sh/j86ysncze1q0eka/AAB8RZtUTkaytqfEGivbev_Ga?dl=0 I am using FlytOS as OS(http://docs.flytbase.com/docs/FlytOS/GettingStarted/OdroidGuide.html). Its customized Ubuntu 16 with OpenCV and ROS setup, makes 11GB after installation. So, I got only 2.4GB free. Therefore, I added 16GB USB as swap memory. I have installed Bazel without

How to monitor validation loss in the training of estimators in TensorFlow?

拥有回忆 提交于 2021-02-07 13:22:47
问题 I want to ask a question about how to monitor validation loss in the training process of estimators in TensorFlow. I have checked a similar question (validation during training of Estimator) asked before, but it did not help much. If I use estimators to build a model, I will give an input function to the Estimator.train() function. But there is no way to add another validation_x, and validation_y data in the training process. Therefore, when the training started, I can only see the training

how to make a scatter plots using tensorboard - tensorflow

佐手、 提交于 2021-02-07 13:12:53
问题 now, i'm studying tensorflow. but, i can't draw dot graph using tensorboard. if i have sample data for training, like that train_X = numpy.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779]) train_Y = numpy.asarray([1.7, 2.76, 2.09, 3.19, 1.694, 1.573, 3.366]) i want to show scatter plots using tensorboard. i know "import matplotlib.pyplot as plt" can do that. but i can just use console (putty). so can't use this method. can i see dot graph, like scatter plots using tensorboard. can anyone

how to make a scatter plots using tensorboard - tensorflow

两盒软妹~` 提交于 2021-02-07 13:12:01
问题 now, i'm studying tensorflow. but, i can't draw dot graph using tensorboard. if i have sample data for training, like that train_X = numpy.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779]) train_Y = numpy.asarray([1.7, 2.76, 2.09, 3.19, 1.694, 1.573, 3.366]) i want to show scatter plots using tensorboard. i know "import matplotlib.pyplot as plt" can do that. but i can just use console (putty). so can't use this method. can i see dot graph, like scatter plots using tensorboard. can anyone

how to make a scatter plots using tensorboard - tensorflow

做~自己de王妃 提交于 2021-02-07 13:10:32
问题 now, i'm studying tensorflow. but, i can't draw dot graph using tensorboard. if i have sample data for training, like that train_X = numpy.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779]) train_Y = numpy.asarray([1.7, 2.76, 2.09, 3.19, 1.694, 1.573, 3.366]) i want to show scatter plots using tensorboard. i know "import matplotlib.pyplot as plt" can do that. but i can just use console (putty). so can't use this method. can i see dot graph, like scatter plots using tensorboard. can anyone

Extract target from Tensorflow PrefetchDataset

回眸只為那壹抹淺笑 提交于 2021-02-07 12:59:41
问题 I am still learning tensorflow and keras, and I suspect this question has a very easy answer I'm just missing due to lack of familiarity. I have a PrefetchDataset object: > print(tf_test) $ <PrefetchDataset shapes: ((None, 99), (None,)), types: (tf.float32, tf.int64)> ...made up of features and a target. I can iterate over it using a for loop: > for example in tf_test: > print(example[0].numpy()) > print(example[1].numpy()) > exit() $ [[-0.31 -0.94 -1.12 ... 0.18 -0.27] [-0.22 -0.54 -0.14 ...

Tensorflow: Tensor to numpy array conversion without running any session

故事扮演 提交于 2021-02-07 12:49:40
问题 I have created an OP in tensorflow where for some processing I need my data to be converted from tensor object to numpy array. I know we can use tf.eval() or sess.run to evaluate any tensor object. What I really want to know is, Is there any way to convert tensor to array without any session running, so in turn we avoid use of .eval() or .run() . Any help is highly appreciated! def tensor_to_array(tensor1): '''Convert tensor object to numpy array''' array1 = SESS.run(tensor1) **#====== need

Segmentation fault (core dumped) on tf.Session()

风流意气都作罢 提交于 2021-02-07 11:54:06
问题 I am new with TensorFlow. I just installed TensorFlow and to test the installation, I tried the following code and as soon as I initiate the TF Session, I am getting the Segmentation fault (core dumped) error. bafhf@remote-server:~$ python Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf /home/bafhf/anaconda3/envs/ismll/lib/python3.6/site-packages/h5py/__init__