waleedka / traffic-signs-tensorflow Goto Github PK
View Code? Open in Web Editor NEWTraffic Signs Detection and Recognition with Tensorflow
Traffic Signs Detection and Recognition with Tensorflow
This is a great project you did and thanks for sharing. I ran into the following error when running your notebook. Could you help? Thank in advance!
ValueError Traceback (most recent call last)
in ()
22 # Define the loss function.
23 # Cross-entropy is a good choice for classification.
---> 24 loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels_ph))
25
26 # Create training op.
/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py in sparse_softmax_cross_entropy_with_logits(_sentinel, labels, logits, name)
1711 """
1712 _ensure_xent_args("sparse_softmax_cross_entropy_with_logits", _sentinel,
-> 1713 labels, logits)
1714
1715 # TODO(pcmurray) Raise an error when the label is not an index in
/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py in _ensure_xent_args(name, sentinel, labels, logits)
1560 if sentinel is not None:
1561 raise ValueError("Only call %s
with "
-> 1562 "named arguments (labels=..., logits=..., ...)" % name)
1563 if labels is None or logits is None:
1564 raise ValueError("Both labels and logits must be provided.")
ValueError: Only call sparse_softmax_cross_entropy_with_logits
with named arguments (labels=..., logits=..., ...)
According to the number of steps trained by the program, the accuracy is very low, only about 40%, increasing the number of steps to 10,000, and the accuracy is only 60%. Why is this?
sample_indexes = random.sample(range(len(images32)), 10)
sample_images = [images32[i] for i in sample_indexes]
sample_labels = [labels[i] for i in sample_indexes]
File "uzip.py", line 65, in
sample_indexes = random.sample(range(len(images32)), 10)
NameError: name 'images32' is not defined
what is images32?
Hello. I know this is an old topic, but still i wanted to ask you how can i use the model i trained on some pictures or even videos of mine?
Xin chào Minh Tân, mình là người đã mail cho bạn. Hi vọng sớm có được liên lạc với bạn
I attended your Traffic Sign Recognition with TensorFlow talk yesterday, thanks for the presentation.
I have a small tip for you to simplify the neural network in your example further.
Currently, you're passing the output from the softmax into tf.argmax
. The softmax part is unnecessary though, since the maximum value stays the same no matter if softmax is used or not. So you can remove the softmax line and use predicted_labels = tf.argmax(logits, 1)
. This model will perform the same as the original. Also you can run the following example to see that the softmax doesn't effect the result of argmax:
example_data = [4.3, 6.6, 8.3, 2.7, 5.5, 4.8, 9.5, 5.6, 4.3]
print("softmax", tf.nn.softmax(example_data).eval(session=tf.Session()))
print("argmax", tf.argmax(example_data, 0).eval(session=tf.Session()))
print("softmax then argmax", tf.argmax(tf.nn.softmax(example_data), 0).eval(session=tf.Session()))
Note that even with this change, your model still uses softmax in the sparse_softmax_cross_entropy_with_logits
function. See the documentation for it here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.