deep-learning

Failed to convert tensorflow frozen graph to pbtxt file

橙三吉。 提交于 2020-08-09 11:01:25
问题 I want to extract pbtxt file given an input of tensorflow frozen inference graph. In order to do this I am using the below script : import tensorflow as tf #from google.protobuf import text_format from tensorflow.python.platform import gfile def converter(filename): with gfile.FastGFile(filename,'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) tf.import_graph_def(graph_def, name='') tf.train.write_graph(graph_def, 'pbtxt/', 'protobuf.pbtxt', as_text=True) print(graph

Tensorflow 2.1.0 - An op outside of the function building code is being passed a “Graph” tensor

China☆狼群 提交于 2020-08-07 05:51:06
问题 I am trying to implement a recent paper. Part of this implementation involves moving from tf 1.14 to tf 2.1.0. The code was working with tf 1.14 but is no longer working. NOTE: If I disable eager execution tf.compat.v1.disable_eager_execution() then the code works as expected. Is this the solution? I've made plenty of models before in TF 2.x and never had to disable eager execution to achieve normal functionality. I have distilled the problem to a very short gist that shows what's happening.

Tensorflow: FailedPreconditionError: Error while reading resource variable from Container: localhost. When running sess.run() on custom loss function

耗尽温柔 提交于 2020-08-06 05:47:35
问题 I have a code running Keras with TensorFlow 1. The code modifies the loss function in order to do deep reinforcement learning: import os import gym import numpy as np import pandas as pd import matplotlib.pyplot as plt env = gym.make("CartPole-v0").env env.reset() n_actions = env.action_space.n state_dim = env.observation_space.shape from tensorflow import keras import random from tensorflow.keras import layers as L import tensorflow as tf from tensorflow.python.keras.backend import set

Tensorflow: FailedPreconditionError: Error while reading resource variable from Container: localhost. When running sess.run() on custom loss function

≯℡__Kan透↙ 提交于 2020-08-06 05:47:27
问题 I have a code running Keras with TensorFlow 1. The code modifies the loss function in order to do deep reinforcement learning: import os import gym import numpy as np import pandas as pd import matplotlib.pyplot as plt env = gym.make("CartPole-v0").env env.reset() n_actions = env.action_space.n state_dim = env.observation_space.shape from tensorflow import keras import random from tensorflow.keras import layers as L import tensorflow as tf from tensorflow.python.keras.backend import set

Tensorflow: FailedPreconditionError: Error while reading resource variable from Container: localhost. When running sess.run() on custom loss function

被刻印的时光 ゝ 提交于 2020-08-06 05:46:24
问题 I have a code running Keras with TensorFlow 1. The code modifies the loss function in order to do deep reinforcement learning: import os import gym import numpy as np import pandas as pd import matplotlib.pyplot as plt env = gym.make("CartPole-v0").env env.reset() n_actions = env.action_space.n state_dim = env.observation_space.shape from tensorflow import keras import random from tensorflow.keras import layers as L import tensorflow as tf from tensorflow.python.keras.backend import set

Using YOLO or other image recognition techniques to identify all alphanumeric text present in images

这一生的挚爱 提交于 2020-08-01 06:20:45
问题 I have multiple images diagram, all of which contains labels as alphanumeric characters instead of just the text label itself. I want my YOLO model to identify all the numbers & alphanumeric characters present in it. How can I train my YOLO model to do the same. The dataset can be found here. https://drive.google.com/open?id=1iEkGcreFaBIJqUdAADDXJbUrSj99bvoi For example : see the bounding boxes. I want YOLO to detect wherever the text are present. However currently its not necessary to

Difference between Dense(2) and Dense(1) as the final layer of a binary classification CNN?

大城市里の小女人 提交于 2020-08-01 03:51:49
问题 In a CNN for binary classification of images, should the shape of output be (number of images, 1) or (number of images, 2)? Specifically, here are 2 kinds of last layer in a CNN: keras.layers.Dense(2, activation = 'softmax')(previousLayer) or keras.layers.Dense(1, activation = 'softmax')(previousLayer) In the first case, for every image there are 2 output values (probability of belonging to group 1 and probability of belonging to group 2). In the second case, each image has only 1 output

Torch LSTMCell Method

独自空忆成欢 提交于 2020-07-23 06:24:19
问题 self.conv1 = nn.Conv2d(num_inputs, 32, 3, stride=2, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv3 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv4 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.lstm = nn.LSTMCell(32 * 3 * 3, 256) Can somebody provide the formula of the calculation lstm input (32 * 3 * 3). Where is this 3 comes from. 来源: https://stackoverflow.com/questions/62724776/torch-lstmcell-method

Torch LSTMCell Method

随声附和 提交于 2020-07-23 06:23:22
问题 self.conv1 = nn.Conv2d(num_inputs, 32, 3, stride=2, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv3 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv4 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.lstm = nn.LSTMCell(32 * 3 * 3, 256) Can somebody provide the formula of the calculation lstm input (32 * 3 * 3). Where is this 3 comes from. 来源: https://stackoverflow.com/questions/62724776/torch-lstmcell-method

Torch LSTMCell Method

情到浓时终转凉″ 提交于 2020-07-23 06:22:18
问题 self.conv1 = nn.Conv2d(num_inputs, 32, 3, stride=2, padding=1) self.conv2 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv3 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.conv4 = nn.Conv2d(32, 32, 3, stride=2, padding=1) self.lstm = nn.LSTMCell(32 * 3 * 3, 256) Can somebody provide the formula of the calculation lstm input (32 * 3 * 3). Where is this 3 comes from. 来源: https://stackoverflow.com/questions/62724776/torch-lstmcell-method