Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何训练mobilenet——v2模型 #17

Open
KelvinHuang666 opened this issue Aug 28, 2019 · 1 comment
Open

如何训练mobilenet——v2模型 #17

KelvinHuang666 opened this issue Aug 28, 2019 · 1 comment

Comments

@KelvinHuang666
Copy link

修改代码直接调用会有bug
修改如下:
with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()):
out, endpoints = mobilenet_v2.mobilenet(input_tensor=input_images)

BUG如下:
Traceback (most recent call last):
File "train_v2.py", line 213, in
snapshot_prefix=snapshot_prefix)
File "train_v2.py", line 158, in train
tf.losses.softmax_cross_entropy(onehot_labels=input_labels, logits=out)
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/ops/losses/losses_impl.py", line 732, in softmax_cross_entropy
logits.get_shape().assert_is_compatible_with(onehot_labels.get_shape())
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 764, in assert_is_compatible_with
raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (?, 1001) and (?, 4) are incompatible

@Ijustakid
Copy link

mobilenet_v2.py的labels_num=1001,看你的分类多少把1001改掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants