tensorflow

How to stack multiple layers of conv2d_transpose() of Tensorflow

拥有回忆 提交于 2021-02-06 09:21:42
问题 I'm trying to stack 2 layers of tf.nn.conv2d_transpose() to up-sample a tensor. It works fine during feed forward, but I get an error during backward propagation: ValueError: Incompatible shapes for broadcasting: (8, 256, 256, 24) and (8, 100, 100, 24) . Basically, I've just set the output of the first conv2d_transpose as the input of the second one: convt_1 = tf.nn.conv2d_transpose(...) convt_2 = tf.nn.conv2d_transpose(conv_1) Using just one conv2d_transpose , everything works fine. The

How to stack multiple layers of conv2d_transpose() of Tensorflow

喜夏-厌秋 提交于 2021-02-06 09:21:09
问题 I'm trying to stack 2 layers of tf.nn.conv2d_transpose() to up-sample a tensor. It works fine during feed forward, but I get an error during backward propagation: ValueError: Incompatible shapes for broadcasting: (8, 256, 256, 24) and (8, 100, 100, 24) . Basically, I've just set the output of the first conv2d_transpose as the input of the second one: convt_1 = tf.nn.conv2d_transpose(...) convt_2 = tf.nn.conv2d_transpose(conv_1) Using just one conv2d_transpose , everything works fine. The

Keras, TensorFlow : “TypeError: Cannot interpret feed_dict key as Tensor”

╄→гoц情女王★ 提交于 2021-02-06 09:20:32
问题 I am trying to use keras fune-tuning to develop image classify applications. I deployed that application to a web server and the image classification is succeeded. However, when the application is used from two or more computers at the same time, the following error message appears and the application doesn't work. TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("Placeholder:0", shape=(3, 3, 3, 64), dtype=float32) is not an element of this graph. Here is my code for image

Tensorflow model import to Java

我与影子孤独终老i 提交于 2021-02-06 09:19:28
问题 I have been trying to import and make use of my trained model (Tensorflow, Python) in Java. I was able to save the model in Python, but encountered problems when I try to make predictions using the same model in Java. Here, you can see the python code for initializing, training, saving the model. Here, you can see the Java code for importing and making predictions for input values. The error message I get is: Exception in thread "main" java.lang.IllegalStateException: Attempting to use

TensorFlow Lite C++ API example for inference

▼魔方 西西 提交于 2021-02-06 09:10:51
问题 I am trying to get a TensorFlow Lite example to run on a machine with an ARM Cortex-A72 processor. Unfortunately, I wasn't able to deploy a test model due to the lack of examples on how to use the C++ API. I will try to explain what I have achieved so far. Create the tflite model I have created a simple linear regression model and converted it, which should approximate the function f(x) = 2x - 1 . I got this code snippet from some tutorial, but I am unable to find it anymore. import

TensorFlow Lite C++ API example for inference

假装没事ソ 提交于 2021-02-06 09:10:17
问题 I am trying to get a TensorFlow Lite example to run on a machine with an ARM Cortex-A72 processor. Unfortunately, I wasn't able to deploy a test model due to the lack of examples on how to use the C++ API. I will try to explain what I have achieved so far. Create the tflite model I have created a simple linear regression model and converted it, which should approximate the function f(x) = 2x - 1 . I got this code snippet from some tutorial, but I am unable to find it anymore. import

TensorFlow Lite C++ API example for inference

做~自己de王妃 提交于 2021-02-06 09:07:31
问题 I am trying to get a TensorFlow Lite example to run on a machine with an ARM Cortex-A72 processor. Unfortunately, I wasn't able to deploy a test model due to the lack of examples on how to use the C++ API. I will try to explain what I have achieved so far. Create the tflite model I have created a simple linear regression model and converted it, which should approximate the function f(x) = 2x - 1 . I got this code snippet from some tutorial, but I am unable to find it anymore. import

Quantize a Keras neural network model

拈花ヽ惹草 提交于 2021-02-06 01:45:23
问题 Recently, I've started creating neural networks with Tensorflow + Keras and I would like to try the quantization feature available in Tensorflow. So far, experimenting with examples from TF tutorials worked just fine and I have this basic working example (from https://www.tensorflow.org/tutorials/keras/basic_classification): import tensorflow as tf from tensorflow import keras fashion_mnist = keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist

Quantize a Keras neural network model

自作多情 提交于 2021-02-06 01:27:31
问题 Recently, I've started creating neural networks with Tensorflow + Keras and I would like to try the quantization feature available in Tensorflow. So far, experimenting with examples from TF tutorials worked just fine and I have this basic working example (from https://www.tensorflow.org/tutorials/keras/basic_classification): import tensorflow as tf from tensorflow import keras fashion_mnist = keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist

TF data API: how to efficiently sample small patches from images

人走茶凉 提交于 2021-02-05 20:35:45
问题 Consider the problem of creating a dataset of sampling random small image patches from a directory of high-resolution images. The Tensorflow dataset API allows for a very easy way of doing this, by constructing a dataset of image names, shuffling them, mapping it to loaded images, then to random cropped patches. However, this naive implementation is very inefficient as a separate high-resolution image will be loaded and cropped to generate each patch. Ideally an image could be loaded once and