tflearn

No module named 'tensorflow.contrib' while importing tflearn

折月煮酒 提交于 2021-01-28 01:18:12
问题 While I was importing tflearn I'm getting this error:- import tflearn Traceback (most recent call last): File "", line 1, in File "/Users/rohansethi/anaconda3/lib/python3.7/site-packages/tflearn/ init .py", line 4, in from . import config File "/Users/rohansethi/anaconda3/lib/python3.7/site-packages/tflearn/config.py", line 5, in from .variables import variable File "/Users/rohansethi/anaconda3/lib/python3.7/site-packages/tflearn/variables.py", line 7, in from tensorflow.contrib.framework

Dataset does not fit in memory

放肆的年华 提交于 2021-01-27 07:08:45
问题 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 a way where we can pass a "batch iterator", instead of an array. Basically for each batch I would load the necessary data from disk. This way I would not run into process memory overflow errors.

Shaping data for linear regression with TFlearn

不问归期 提交于 2020-02-23 04:39:05
问题 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,

How to load and retrain tflean model

泄露秘密 提交于 2020-01-14 03:02:40
问题 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

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

天涯浪子 提交于 2020-01-01 03:43:17
问题 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

Python Tflearn machine learning Optimiser, loss and parameters

偶尔善良 提交于 2019-12-26 15:51:12
问题 After fixing my code and prepare my data for training I've found myself in front of 2 question. Background : I have data made of date (one entry per minute) for the first column and congestion (value, between 0 and 200) for the 2nd. My goal is to feed it to my neural network and so be able to predict for the next week the congestion at each minute (my dataset is more than 10M of entry, I shouldn't have problem of lack of data for training). Problem : I now have two question. First about the

Python Tflearn machine learning Optimiser, loss and parameters

一曲冷凌霜 提交于 2019-12-26 15:51:09
问题 After fixing my code and prepare my data for training I've found myself in front of 2 question. Background : I have data made of date (one entry per minute) for the first column and congestion (value, between 0 and 200) for the 2nd. My goal is to feed it to my neural network and so be able to predict for the next week the congestion at each minute (my dataset is more than 10M of entry, I shouldn't have problem of lack of data for training). Problem : I now have two question. First about the

RuntimeError: Attempted to use a closed Session in tflearn

烂漫一生 提交于 2019-12-23 19:55:25
问题 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).reshape(-1,WIDTH,HEIGHT,1) for sd in range(len(y)): idx = genres.index(y[sd]) y[sd] = idx print(y) y = np.array(y) try: model.load(MODEL_NAME) except: print("no model") model.fit({'input': x}, {

Variables with dynamic shape TensorFlow

两盒软妹~` 提交于 2019-12-12 10:39:22
问题 I need to create a matrix in TensorFlow to store some values. The trick is the matrix has to support dynamic shape. I am trying to do the same I would do in numpy: myVar = tf.Variable(tf.zeros((x,y), validate_shape=False) where x=(?) and y=2 . But this does not work because zeros does not support 'partially known TensorShape', so, How should I do this in TensorFlow? 回答1: 1) You could use tf.fill(dims, value=0.0) which works with dynamic shapes. 2) You could use a placeholder for the variable

Wrong output of prediction function in tensorflow

落爺英雄遲暮 提交于 2019-12-12 01:21:27
问题 I am going to perform pixel-based classification on an image. Here is the code I used for training the NN net = input_data(shape=[None, 1,4]) net = tflearn.lstm(net, 128, return_seq=True) net = tflearn.lstm(net, 128) net = tflearn.fully_connected(net, 1, activation='softmax') net = tflearn.regression(net, optimizer='adam', loss='categorical_crossentropy') model = tflearn.DNN(net, tensorboard_verbose=2, checkpoint_path='model.tfl.ckpt') X_train = np.expand_dims(X_train, axis=1) model.fit(X