Quantcast
Channel: Tensorflor/TFLearn Cannot feed value of shape - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Gustav Oskarsson for Tensorflor/TFLearn Cannot feed value of shape

$
0
0

Thanks for the answer!

I got the problem solved, so here is the code:

import numpy as np
import tflearn
from tflearn.data_utils import load_csv
from numpy import genfromtxt


data, target = load_csv('boston_train.csv', has_header=True)
target = np.reshape(target, (-1,1))

net = tflearn.input_data(shape=[None, 9])
net = tflearn.fully_connected(net, 9)
net = tflearn.fully_connected(net, 1)
net = tflearn.regression(net, optimizer='sgd', loss='mean_square', learning_rate=0.01)
net = tflearn.DNN(net)
net.fit(data, target, n_epoch=10, batch_size=10, show_metric=True)

test_data = genfromtxt('boston_predict.csv', delimiter=',', skip_header = 1)
test_data = np.reshape(test_data, (-1,9))

pred = net.predict(test_data)
print(pred)

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>