tflearn

Error with shape in tflearn(neural network)

▼魔方 西西 提交于 2019-12-08 11:39:37
问题 I'm write a code in my data test, but have error in shape. my matrix "X" contains 4 columns and 3824 lines. I want to predict the dose of radiation in a certain place with 4 inputs and 1 output In the future I will increase the entries but I want to do a test with this database first using example: https://github.com/tflearn/tflearn/blob/master/examples/images/dnn.py code: from __future__ import division, print_function, absolute_import import tflearn from sklearn import preprocessing import

How to train mix of image and data in CNN using ImageAugmentation in TFlearn

和自甴很熟 提交于 2019-12-07 18:12:59
问题 I would like to train a convolutional neural network in Tflearn-Tensorflow using a mix of images (pixel info) and data. Because I have a short number of images, I need to use the Image Augmentation to increase the number of image samples that I pass to the network. But that means that I can only pass image data as input data, having to add the non-image data at a later stage, presumably before the fully connected layer. I can't work out how to do this, since it seems that I can only tell the

In Tensorflow how to freeze saved model

若如初见. 提交于 2019-12-07 12:30:31
问题 This is probably a very basic question... But how do I convert checkpoint files into a single .pb file. My goal is to serve the model using probably C++ These are the files that I'm trying to convert. As a side note I'm using tflearn with tensorflow. Edit 1: I found an article that explains how to do this: https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc The problem is that I'm stuck with the following error KeyError: "The name 'Adam'

How to load and retrain tflean model

主宰稳场 提交于 2019-12-07 04:59:25
I am trying DNN- RNN on a text data set. It is a simple dummy data and I think the code can be used with most of text data. However I am getting error when I am trying to load the trained model and then retrain it. Please tell me If I am doing it wrong. def convert_docs(documents,no_class=2,MAX_DOCUMENT_LENGTH=200): '''Takes list of docs and associated clas list as input. Prepares it for the tflearn library. documents should be a list of strings and clas should be a numbered list of classes encoded into 0,1,2 etc. no_classes is the number of classes that are going to be used in the model this

Shaping data for linear regression with TFlearn

爱⌒轻易说出口 提交于 2019-12-07 00:09:26
I'm trying to expand the tflearn example for linear regression by increasing the number of columns to 21. from trafficdata import X,Y import tflearn print(X.shape) #(1054, 21) print(Y.shape) #(1054,) # Linear Regression graph input_ = tflearn.input_data(shape=[None,21]) linear = tflearn.single_unit(input_) regression = tflearn.regression(linear, optimizer='sgd', loss='mean_square', metric='R2', learning_rate=0.01) m = tflearn.DNN(regression) m.fit(X, Y, n_epoch=1000, show_metric=True, snapshot_epoch=False) print("\nRegression result:") print("Y = " + str(m.get_weights(linear.W)) + "*X + " +

In Tensorflow how to freeze saved model

主宰稳场 提交于 2019-12-05 18:06:11
This is probably a very basic question... But how do I convert checkpoint files into a single .pb file. My goal is to serve the model using probably C++ These are the files that I'm trying to convert. As a side note I'm using tflearn with tensorflow. Edit 1: I found an article that explains how to do this: https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc The problem is that I'm stuck with the following error KeyError: "The name 'Adam' refers to an Operation not in the graph." How do I fix this? Edit 2: Maybe this will shed some light on the

How to create feature columns for TensorFlow classifier

余生长醉 提交于 2019-12-05 02:20:18
问题 I have a very simple dataset for binary classification in csv file which looks like this: "feature1","feature2","label" 1,0,1 0,1,0 ... where the "label" column indicates class (1 is positive, 0 is negative). The number of features is actually pretty big but it doesn't matter for that question. Here is how I read the data: train = pandas.read_csv(TRAINING_FILE) y_train, X_train = train['label'], train[['feature1', 'feature2']].fillna(0) test = pandas.read_csv(TEST_FILE) y_test, X_test = test[

Run a Tensorflow model without having Tensorflow installed

二次信任 提交于 2019-12-04 01:53:01
问题 I have a TF model that works well, constructed with Python and TFlearn. Is there a way to run this model on another system without installing Tensorflow on it? It is already pre-trained, so I just need to run data through it. I am aware of tfcompile (Thread here), but it seems quite complex to set up. Are there any alternatives? 回答1: Is there a way to run this model on another system without installing Tensorflow on it? It is already pre-trained, so I just need to run data through it. Yes

How to create feature columns for TensorFlow classifier

泄露秘密 提交于 2019-12-03 17:08:29
I have a very simple dataset for binary classification in csv file which looks like this: "feature1","feature2","label" 1,0,1 0,1,0 ... where the "label" column indicates class (1 is positive, 0 is negative). The number of features is actually pretty big but it doesn't matter for that question. Here is how I read the data: train = pandas.read_csv(TRAINING_FILE) y_train, X_train = train['label'], train[['feature1', 'feature2']].fillna(0) test = pandas.read_csv(TEST_FILE) y_test, X_test = test['label'], test[['feature1', 'feature2']].fillna(0) I want to run tensorflow.contrib.learn

How can i detect and localize object using tensorflow and convolutional neural network?

夙愿已清 提交于 2019-12-03 09:54:11
My problem statement is as follows : " Object Detection and Localization using Tensorflow and convolutional neural network " What i did ? I am done with the cat detection from images using tflearn library.I successfully trained a model using 25000 images of cats and its working fine with good accuracy. Current Result : What i wanted to do? If my image consist of two or more than two objects in the same image for example cat and dog together so my result should be 'cat and dog' and apart from this i have to find the exact location of these two objects on the image( bounding box ) I came across