Giter VIP home page Giter VIP logo

Comments (8)

shlens avatar shlens commented on May 4, 2024

Would you be able to provide more details about what you have modified and possibly the full log of running the model?

from models.

cosmok avatar cosmok commented on May 4, 2024

How can I create a inception model on a custom dataset (not flowers. I am piggy backing off the flowers train scripts)?

Below is the complete error
`$ bazel-bin/inception/flowers_train --train_dir="${TRAIN_DIR}" --data_dir="${FLOWERS_DATA_DIR}" --fine_tune=True --initial_learning_r
ate=0.001 --input_queue_memory_factor=1

W tensorflow/core/framework/op_kernel.cc:896] Invalid argument: indices[0] = [0,44] is out of bounds: need 0 <= index < [32,6]
Traceback (most recent call last):
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/flowers_train.py", line 41, in
tf.app.run()
File "/Library/Python/2.7/site-packages/tensorflow/python/platform/default/_app.py", line 30, in run
sys.exit(main(sys.argv))
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/flowers_train.py", line 37, in main
inception_train.train(dataset)
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/inception_train.py", line 332, in train
_, loss_value = sess.run([train_op, loss])
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 313, in run
return self._run(None, fetches, feed_dict)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 509, in _run
feed_dict_string)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 562, in _do_run
target_list)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 584, in _do_call
e.code)
tensorflow.python.framework.errors.InvalidArgumentError: indices[0] = [0,44] is out of bounds: need 0 <= index < [32,6]
[[Node: tower_0/SparseToDense = SparseToDense[T=DT_FLOAT, Tindices=DT_INT32, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](tower_0/concat, tower_0/SparseToDense/output_shape, tower_0/SparseToDense/sparse_values, tower_0/SparseToDense/default_value)]]
Caused by op u'tower_0/SparseToDense', defined at:
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/flowers_train.py", line 41, in
tf.app.run()
File "/Library/Python/2.7/site-packages/tensorflow/python/platform/default/_app.py", line 30, in run
sys.exit(main(sys.argv))
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/flowers_train.py", line 37, in main
inception_train.train(dataset)
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/inception_train.py", line 235, in train
loss = _tower_loss(images, labels, num_classes, scope)
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/inception_train.py", line 115, in _tower_loss
inception.loss(logits, labels, batch_size=split_batch_size)
File "/Users/k7/workspace/tensor_models/inception/bazel-bin/inception/flowers_train.runfiles/inception/inception_model.py", line 125, in loss
1.0, 0.0)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/sparse_ops.py", line 362, in sparse_to_dense
name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_sparse_ops.py", line 362, in _sparse_to_dense
validate_indices=validate_indices, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/op_def_library.py", line 655, in apply_op
op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 2102, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 1129, in init
self._traceback = _extract_stack()`

from models.

shlens avatar shlens commented on May 4, 2024

Piggy-backing on the flowers data set is precisely our intention for releasing the example of the flowers data set, so I am glad it provides a good start.

Did you already generate the data and place it in $FLOWERS_DATA_DIR?

Also, if you did generate the new data set already, did you update num_classes() and num_examples_per_epoch() in flowers_data.py to correspond with your data?

https://github.com/tensorflow/models/blob/master/inception/inception/flowers_data.py#L34

from models.

cosmok avatar cosmok commented on May 4, 2024

Ah, didn't realize that I had explicitly set those (as that info could have been determined at runtime).

I have got the training script to run now. Thanks a lot for your help!

from models.

achaiah avatar achaiah commented on May 4, 2024

Hi, could this please become part of the writeup here: https://github.com/tensorflow/models/blob/master/inception/README.md

It has tripped me up and I'm sure others will also not realize that this needs to be done.

Thanks.

from models.

pavanyvs avatar pavanyvs commented on May 4, 2024

I am trying to build a model using flowers_train.py and got the same error. Here I changed the "examples" and "classes" for both flowers_data.py and build_image_data.py corresponding to my custom data. Still I am stuck with this error. Can anyone help me with this issue?

from models.

s-mason avatar s-mason commented on May 4, 2024

i have encounter this problem ,too. that indicates that your indicies do be out of bound . print it ,and check carefully. best wishes.

from models.

Flyzanetothesky avatar Flyzanetothesky commented on May 4, 2024

I meet the similar problem. I found my labels begin from 1 but not 0, so I changed the sequence of labels. Hope my answer can help you !

from models.

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.