Giter VIP home page Giter VIP logo

Comments (4)

SardarKhan299 avatar SardarKhan299 commented on May 26, 2024

Hy @Aawesh
Can you help me to solve this error.?
2018-04-10 11:53:45.778484: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Traceback (most recent call last):
File "D:/Sardar.Khan/Courses/TensorFlow Course/Building and Deploy Deep Learning/Ex_Files_TensorFlow/Exercise Files/03/Model/main.py", line 195, in
_, c = session.run([optimizer, loss], feed_dict={X: batch_x, Y: batch_y})
File "D:\Sardar.Khan\Courses\TensorFlow Course\Building and Deploy Deep Learning\Ex_Files_TensorFlow\Exercise Files\venv\lib\site-packages\tensorflow\python\client\session.py", line 905, in run
run_metadata_ptr)
File "D:\Sardar.Khan\Courses\TensorFlow Course\Building and Deploy Deep Learning\Ex_Files_TensorFlow\Exercise Files\venv\lib\site-packages\tensorflow\python\client\session.py", line 1113, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (10, 1) for Tensor 'Placeholder_1:0', which has shape '(?, 6)'

Process finished with exit code 1
at this line..
_, c = session.run([optimizer, loss], feed_dict={X: batch_x, Y: batch_y})

with tf.Session() as session:
session.run(tf.global_variables_initializer())
for epoch in range(training_epochs):
for b in range(total_batches):
offset = (b * batch_size) % (train_y.shape[0] - batch_size)
batch_x = train_x[offset:(offset + batch_size), :, :, :]
batch_y = train_y[offset:(offset + batch_size), :]
_, c = session.run([optimizer, loss], feed_dict={X: batch_x, Y: batch_y})
cost_history = np.append(cost_history, c)
print("Epoch: ", epoch, " Training Loss: ",c, " Training Accuracy: ",session.run(accuracy, feed_dict={X: train_x, Y: train_y}))
print("Testing Accuracy:", session.run(accuracy, feed_dict={X: test_x, Y: test_y}))

from human-activity-recognition-using-cnn.

aqibsaeed avatar aqibsaeed commented on May 26, 2024

The error is this: ValueError: Cannot feed value of shape (10, 1) for Tensor 'Placeholder_1:0', which has shape '(?, 6)

You are trying to feed class labels array which has a shape of (10, 1) into a placeholder y with shape (None, 6). I would suggest try printing your class labels' numpy array and make sure placeholder and array have same shape.

Hope this helps.

from human-activity-recognition-using-cnn.

SardarKhan299 avatar SardarKhan299 commented on May 26, 2024

I follow the same tutorial given by you but its show this error.

from human-activity-recognition-using-cnn.

Aawesh avatar Aawesh commented on May 26, 2024

Make sure your data have all output labels equally. By equally I mean, the test data (after divided into training and testing) must contain all 6 labels (in your case). Don't just keep first 100 (for example) rows just like that for debugging purpose. Change the activity values. Let's say walking = 1, Jumping = 2, Running = 3, etc. The problem here is, all your test data contains only one output label. I have answered this on the blog as well. I hope this finds you well.

from human-activity-recognition-using-cnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.