# Questions tagged [tflearn]

78 questions

0

votes

1

answer

11

Views

### ModuleNotFoundError: No module named 'ioc' in TFlearn Image Classification

I am designing an image classifier using CNN in python, pycharm. I want to plot an accuracy graph at the end. Following is my code to plot the graph:
hist = {
'Accuracy' : [x.value for x in ea.Scalars('Accuracy')],
'Validation Accuracy' : [x.value for x in ea.Scalars('Accuracy/Validation')],
'L...

1

votes

1

answer

145

Views

### Does batch normalization in tensorflow use running averages during training?

I am using a tensorflow neural net to figure out how batch normalization works and replicate it in my own library. I've run into this strange issue:
When you initialize a neural net layer, all biases (or in case of batchnorm - betas) are set to 0, so the layer should just multiply the input values...

1

votes

5

answer

6.6k

Views

### How to install tflearn module on anaconda distribution in windows 10

I have already install most of the libraries on anaconda. In one of my code is showing that No module named 'tflearn'.
I also used the command conda install tflearn.
it shows the failed message.
PackagesNotFoundError: The following packages are not available from
current channels:
tflearn
Current c...

4

votes

1

answer

2.7k

Views

### In Tensorflow how to freeze saved model

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 d...

4

votes

3

answer

4.1k

Views

### Linking Tensorboard Embedding Metadata to checkpoint

I'm using the tflearn wrapper over tensorflow to build a model, and would like to add metadata (labels) to the resultant embedding visualization. Is there a way to link a metadata.tsv file to a saved checkpoint after the fact of running it?
I've created a projector_config.pbtxt file in the logdir...

4

votes

1

answer

311

Views

### TfLearn Confusion Matrix training terminated on std::bad_alloc

Having problems working out how to get a confusion matrix when using TFLearn for the creation of a convolutional neural network. The code I have so far is as follows:
from __future__ import division, print_function, absolute_import
import tflearn
from tflearn.layers.core import input_data, dropout,...

1

votes

0

answer

9

Views

### tflearn error: Shape must be rank 1 but is rank 2 for 'strided_slice'. How should I change to correct rank?

I am attempting to make a CRNN (Convolutional Recurrent Neural Network), using tflearn, which inputs 17 grayscale images of 28 by 28.
The network is:
def rnn_conv_lstm_model(width, height, sequence_length):
network = tflearn.input_data(shape=[None, sequence_length, height, width, 1])
network = tflea...

3

votes

2

answer

309

Views

### Preprocessing csv files to use with tflearn

My question is about preprocessing csv files before inputing them into a neural network.
I want to build a deep neural network for the famous iris dataset using tflearn in python 3.
Dataset: http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data
I'm using tflearn to load the csv fi...

1

votes

1

answer

3.4k

Views

### How to use tflearn deep learning for document classification

I am using tflearn and tensorflow to classify documents. However I am facing issue with the size of the document and training time, the length of my largest document is ~98000 words and using this for the building the network is going to be extremely time consuming. I was looking at different method...

3

votes

0

answer

891

Views

### RuntimeError: Attempted to use a closed Session in tflearn

I want to train my model with tflearn, but i get the error showed above.
Here is my training loop:
BTW I splitted my training inputs in seperate numpy files
for i in range(EPOCHS):
for file in filess:
file = np.load(file)
x = []
y = []
for a, b in file:
x.append(a)
y.append(b[0])
x = np.array(x).res...

7

votes

1

answer

8k

Views

### Tensorflow dynamic RNN (LSTM): how to format input?

I have been given some data of this format and the following details:
person1, day1, feature1, feature2, ..., featureN, label
person1, day2, feature1, feature2, ..., featureN, label
...
person1, dayN, feature1, feature2, ..., featureN, label
person2, day1, feature1, feature2, ..., featureN, label
pe...

4

votes

1

answer

3k

Views

### Batch_size in tensorflow? Understanding the concept

My question is simple and stright forward. What does a batch size specify while training and predicting a neural network. How to visualize it so as to get a clear picture of how data is being feed to the network.
Suppose I have an autoencoder
encoder = tflearn.input_data(shape=[None, 41])
encoder =...

2

votes

1

answer

2.6k

Views

### “Scipy not supported!” while importing tflearn

I am using Ubuntu subsystem on Windows 10 and started learning tflearn (and TensorFlow). After installing both of them, I tried running python2.7, and then import tflearn, but it gives "Scipy not supported!". Can anyone help me to resolve this?

3

votes

3

answer

535

Views

### Using KMeans tflearn estimator as part of a graph in tensorflow

I am trying to use tensorflow.contrib.learn.KMeansClustering as part of a graph in Tensorflow. I would like to use it as a component of a graph, giving me predictions and centers. The relevant part of the code is the following:
with tf.variable_scope('kmeans'):
kmeans = KMeansClustering(num_clusters...

1

votes

1

answer

493

Views

### ValueError: Cannot feed value of shape (64, 32, 32) for Tensor u'InputData/X:0', which has shape '(?, 32, 32, 1)'

I am trying to train model using tflearn and my own data.
I have 19748 greyscale images which I want to train using my model. I used Image_Preloader method of tflearn to input image. And all images are converted into 32*32 size. But when I start the training process I get this error "ValueError: Can...

2

votes

1

answer

396

Views

### which higher layer abstraction to use for tensorflow

I am looking for higher layer abstractions for my deep learning project.
Few doubts lately.
I am really confused about which is more actively maintained tflearn(docs), or tensorflow.contrib.learn. But projects are different and actively contributed on Github. I did not find why are people working th...

2

votes

2

answer

1.5k

Views

### Using a custom layer to define connectivity in tensorflow / tflearn

Instead of a fully connected layer, I would like to specify the connectivity between activation nodes using a matrix. For example:
I have a 20 node layer that is connected to a 10 node layer. Using a typical fully connected layer, my W matrix is 20 x 10, with a b vector of size 10.
My activation lo...

1

votes

1

answer

2.6k

Views

### AttributeError: 'Tensor' object has no attribute 'initialized_value'

Here's my code
https://gist.github.com/Wermarter/318756a2f4cda35ebb178a932e1f8c38
I'm trying to implement VAE with TFLearn but the compiler said:
Traceback (most recent call last):
File "/home/wermarter/Desktop/ChienVAE_RawTF.py", line 107, in
main()
File "/home/wermarter/Desktop/ChienVAE_RawTF.py"...

2

votes

1

answer

1.4k

Views

### tflearn custom loss function for cosine similarity

I have an lstm network in tflearn that predicts the next word in a sequence given a context of preceding words. The words are fed into the network as indices of a certain-sized vocabulary, and are output in binary classes, for example:
context: [45, 243, 1, 1906, 4, 2, 0, 0, 0, 0]
label: [0,0,0......

1

votes

2

answer

3.7k

Views

### AttributeError: module 'tensorflow' has no attribute 'unpack'

I am trying to run a lstm model using tfLearn and I get this error:
File "...city_names.py", line 16, in
g = tflearn.lstm(g, 256, activation='relu', return_seq=True)
File "...\tflearn\layers\recurrent.py", line 197, in lstm
inference = tf.unpack(inference)
AttributeError: module 'tensorflow' has n...

2

votes

1

answer

761

Views

### Cannot run tflearn with sklearn's GridSearchCV

I intend to perform a grid search over hyperparams of a tflearn model. It seems that the model produced by tflearn.DNN is not compatible with sklearn's GridSearchCV expectations:
from sklearn.grid_search import GridSearchCV
import tflearn
import tflearn.datasets.mnist as mnist
import numpy as np
X,...

2

votes

2

answer

3.7k

Views

### How to create feature columns for TensorFlow classifier

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...

2

votes

1

answer

492

Views

### How to implement the 'group' of alexnet in tensorlayer

group are used to group parameters of the convolution kernel (which connects the previous layer and the current layer) into k parts forcibly in alexnet, is there a simple implement for group in tensorlayer?

2

votes

1

answer

532

Views

### InvalidArgumentError : You must feed a value for placeholder tensor 'input_1/X' with dtype float

I am new to tensorflow and tflearn and getting this error while training the model.
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'input_1/X' with dtype float
[[Node: input_1/X = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/ta...

2

votes

2

answer

820

Views

### TFlearn - VocabularyProcessor ignores parts of given vocabulary

I am using the VocabularyProcessor of TFlearn to map documents to integer arrays. However, I don't seem to be able to initialize the VocabularyProcessor with my own vocabulary. In the docs it says that I can provide a vocabulary when creating the VocabularyProcessor as in:
vocab_processor = learn.pr...

2

votes

0

answer

431

Views

### tflearn initialization with numpy.array

I am using tflearn to create a Auto-encoder, now I want to initialize the weights and bias using the learned parameters (np.array) from RBM.
I tried methods such as:
w = tf.get_variable('w1', shape=(784, 256), initializer=tf.constant_initializer(w0))
for
encoder = tflearn.fully_connected(encoder, 25...

2

votes

0

answer

772

Views

### LSTM model approach for time series (future prediction)

I am new to tensorflow/tflearn and deep learning so these may be basic questions but I would appreciate any input.
Question 1: I have been able to successfully run a LSTM model using tflearn on a set of 2 years of time series data/sequence. I can run the model via variations of "look_back" (e.g. 1...

3

votes

4

answer

2.3k

Views

### tf.contrib.learn load_csv_with_header not working in TensorFlow 1.1

I installed the latest TensorFlow (v1.1.0) and I tried to run the tf.contrib.learn Quickstart tutorial, where you suppose to build a classifier for the IRIS data set. However, when I tried:
training_set = tf.contrib.learn.datasets.base.load_csv_with_header(
filename=IRIS_TRAINING,
target_dtype=np.in...

2

votes

0

answer

297

Views

### How to use pre-built word embedding in tfLearn?

I would like to build recurrent neural net binary classifier in tfLearn. But I want to use my pre-built word embedding, which I have saved in the pickle. Following is the tflearn code I am using in the model.
# Network building
net = tflearn.input_data([None, 100])
net = tflearn.embedding(net, input...

2

votes

1

answer

430

Views

### Tflearn Custom Objective function

I am creating a custom objective function for my tflearn model. The objective function is complex and requires me to iterate through the predicted and correct outputs and add certain parts not based on index. I cannot find a way to make it work with the tensor datatype.
I have coded a version usin...

2

votes

1

answer

571

Views

### TFLearn - Large Dataset going to NaN loss

I don't know if you can help me here, but I am having a problem I can't figure out. I have a large (for me) data set of around 450,000 entries. Each entry is an list of about ~700 integers, formatted like this:
[217088.0, 212992.0, 696.0, 191891.0, 524.0, 320.0, 0.0, 496.0, 0, 0, 364.0, 20.0, 0, 1.0...

2

votes

1

answer

688

Views

### Dataset does not fit in memory

I have an MNIST like dataset that does not fit in memory, (process memory, not gpu memory).
My dataset is 4GB.
This is not a TFLearn issue.
As far as I know model.fit requires an array for x and y.
TFLearn example:
model.fit(x, y, n_epoch=10, validation_set=(val_x, val_y))
I was wondering is there's...

2

votes

1

answer

304

Views

### What is the difference between global_max_pool/global_avg_pool and avg_pool_2d/1d/3d?

I've tried to compare the tutorial code for text classification from tflearn : https://github.com/tflearn/tflearn/blob/master/examples/nlp/cnn_sentence_classification.py
And the one from dennybritz :
https://github.com/dennybritz/cnn-text-classification-tf
These 2 codes shows different result, i und...

2

votes

1

answer

162

Views

### Why does a custom activation function cause network both zero loss and low accuracy?

I was trying to build a custom activation function using tflearn by making following changes:
add my custom activation function to activation.py
def my_activation(x):
return tf.where(x >= 0.0, tf.div( x**2 , x + tf.constant(0.6)) , 0.01*x)
and add it to the __init__.py
from .activations import linea...

2

votes

1

answer

209

Views

### TFlearn IndexError out of bounds

I have some data which looks like this:
X = [[1,2,3,4],[01010],[-1.6]]
y = [[4,2]]
I am trying to train a neural net on this data using tflearn. I'm using the same example given on the TFlearn github homepage (https://github.com/tflearn/tflearn) except that I have changed the shape of the data.
tfle...

2

votes

1

answer

605

Views

### DNN with tflearn always predicts the same value

I am just starting with using tflearn/tensorflow for machine learning, and I am having a problem with the model below.
It always predicts the same outcome, out of two possible from the data set (0 or 1).
I have made sure that my inputs are of fdatatype float, and that my training set is balanced. A...

2

votes

1

answer

667

Views

### What is the relationship between tflearn and tf.contrib.learn?

What is the relationship between tflearn and tf.contrib.learn?

2

votes

1

answer

79

Views

### not able to create a working population of neural network with tflearn (Tensorflow)

I want to train a neural network with a genetic algorithm. I use the tflearn library to create my network. When I predict the outcome of my network one time everything is fine, however when I create a loop where in every iteration I create a new model of the network I get errors. In the first iterat...

2

votes

2

answer

2.5k

Views

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

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 accura...

2

votes

0

answer

319

Views

### How to implement lstm with fully connected neural network on both input and outputs using tflearn?

I need to implement a lstm where both the input and outputs are passed through fully connected neural network? Right now, I am jumping through hoops to implement this. I need to know if this will work and if it can be implemented more efficiently
inputs = tflearn.input_data(shape=[None, seq_len, ip_...