im2txt
I just updated im2txt to
commit 5e250ff9e9e9cb8137e5d8d37d992a93fe2b65bf
Author: Christopher Shallue <[email protected]>
Date: Tue Jan 10 11:02:03 2017 -0800
but am getting the error:
AttributeError: 'module' object has no attribute 'BasicLSTMCell'
Anyone else getting this? Or is there something wrong with my config?
I tried the code change recommended in
https://github.com/tensorflow/tensorflow/issues/6432
Which seems to fix the BasicLSTMCell problem but leads to the odd error:
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/show_and_tell_model.py", line 273, in build_model
state_tuple = tf.split(value=state_feed, num_or_size_splits=2, axis=1)
TypeError: split() got an unexpected keyword argument 'num_or_size_splits'
Here is the full text of the original error message:
INFO: Found 1 target...
Target //im2txt:run_inference up-to-date:
bazel-bin/im2txt/run_inference
INFO: Elapsed time: 0.276s, Critical Path: 0.01s
Traceback (most recent call last):
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/run_inference.py", line 83, in <module>
tf.app.run()
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/run_inference.py", line 49, in main
FLAGS.checkpoint_path)
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/inference_utils/inference_wrapper_base.py", line 115, in build_graph_from_config
self.build_model(model_config)
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/inference_wrapper.py", line 36, in build_model
model.build()
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/show_and_tell_model.py", line 356, in build
self.build_model()
File "/data/home/me/tensorflow_models/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/show_and_tell_model.py", line 247, in build_model
lstm_cell = tf.contrib.rnn.BasicLSTMCell(
AttributeError: 'module' object has no attribute 'BasicLSTMCell'
Could this be related to one of the things in the 1.0 release notes?
Are you tracking the version of TensorFlow specified in the git submodules file?
@jart Thanks for the tip.
Yes, that was the problem. I had an older version of TensorFlow installed and did not catch the updated version requirement for im2txt.
Glad the problem was solved. Let us know if you find any bugs or have feature requests in the future.
Hey, sorry to resurrect this one, but to which submodules file do you refer? the one in the root of this models repo? because that one seemed out of date, and im2txt requires only "TensorFlow r0.12 or greater" in the README. I have 0.12.1. do I need to lock the version down more?
i had the same issues. needed to change tf.nn.rnn_cell.BasicLSTMCell and then wrong split params.
Very odd. I'm getting the same error again. Now with current versions of TensorFlow and im2txt
Any thoughts?
$ipython -c 'import tensorflow as tf; print(tf.__version__)'
0.12.1
$ git merge origin master
Already up-to-date.
$ bazel-bin/im2txt/run_inference --checkpoint_path=${CHECKPOINT_DIR} --vocab_file=${VOCAB_FILE} --input_files=${IMAGE_FILE}
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/run_inference.py", line 83, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/run_inference.py", line 49, in main
FLAGS.checkpoint_path)
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/inference_utils/inference_wrapper_base.py", line 115, in build_graph_from_config
self.build_model(model_config)
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/inference_wrapper.py", line 36, in build_model
model.build()
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/show_and_tell_model.py", line 356, in build
self.build_model()
File "/home/me/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/show_and_tell_model.py", line 247, in build_model
lstm_cell = tf.contrib.rnn.BasicLSTMCell(
AttributeError: 'module' object has no attribute 'BasicLSTMCell'
I can confirm these(BasicLSTM and split) errors with python 3.5 and tensorflow 12.1.
Can anyone post correct line using tf.split()? Thanks
Can a contributor assign a label of bug, please?
Thx
To fix tf.split issue replace:
_state_tuple = tf.split(value=state_feed, num_or_size_splits=2, axis=1)_
with
_state_tuple = tf.split(split_dim=1, num_split=2, value=state_feed)_
@orlov-alexander Excuse me.It's 247th lines throw a error.Thx!
@orlov-alexander, @lightningsoon
I'm having trouble finding a working combination of im2txt and Tensorflow versions.
What are git SHA for tensorflow/models and tensorflow/tensorflow are you using?
git log -1 --format="%H"
Thanks.
I have dealt with my problem by referring to tensorflow's tutorial.
copy with google
version r0.11
tf.nn.rnn_cell.BasicRNNCell.__init__(num_units, input_size=None, activation=tanh) {:#BasicRNNCell.init}
Come on!
I can you too.
@lightningsoon
Thanks.
Just to confirm, you are using a current version of the im2txt model with the modification you listed, correct?
We've been getting a whole bunch of issues lately about compatibility with tensorflow/models and tensorflow/tensorflow, in light of all the 1.0 refactoring and API changes. I recommend following #902.
One thing I will mention is that this repo, it's basically the wild west. These models are largely user contributed and community supported. We also currently don't have a process in place to sync changes here with our internal repository. While we're doing our best to stay on top of these issues, we still really depend on the community to help keep this repo in order, until we can put effective processes in place. Any help you guys can offer will be greatly appreciated and will serve the interests of the community.
Thanks for the update! would PRs be accepted then, if they help put this repo under some form of CI? is there any reason that hasn't yet been put in place? Its probably best to follow the current Jenkins approach and not use travis for this?
Oh yes, absolutely. Many of the authors of these models never wrote tests, so tests would be fantastic. Adding CI to this repo would also be incredible. Although please have a conversation with @gunan before beginning any such effort. We'll want to decide if it would be better to integrate with the existing Jenkins setup, or perhaps set something up with Travis, which would be much easier for those outside @gunan's team to maintain.
I also want to bring to your attention that @martinwicke is planning on setting up a TensorFlow Models "Garden" of the cream of the crop models which are going to have the best tests and best support. Talking with him might be able to help you focus your contributions on the places that will have the most impact.
/CC @nealwu
Adding CI to this repo has been in our radar, but we never 'got around to it' due to current load.
Neal, we can sync and figure out what we would like to run continuously on this repo.
Googlers @jart, @gunan and others, and non-Googlers @joedaniels29 and others....
Thanks for looking into this, much appreciated.
@ProgramItUp
tensorflow -V 0.12.1
python -V 2.7.12
@ProgramItUp
modify show and tell model.py 247th line
@lightningsoon thanks for the detail.
Just to confirm, you are using a current version of im2txt, correct?
The reason I ask is I'm getting errors even when using Tensorflow .11. (I on my mobile device at the moment and can look the exact error in the morning.)
Thanks.
...erence.runfiles/__main__/im2txt/inference_utils/inference_wrapper_base.py", line 92, in _create_restore_fn
raise ValueError("No checkpoint file found in: %s" % checkpoint_path)
ValueError: No checkpoint file found in: None
What could go wrong ?
bazel-bin/im2txt/run_inference --checkpoint_path=im2txt/model/train/ --vocab_file=im2txt/data/mscoco/word_counts.txt --input_files=im2txt/data/mscoco/raw-data/man_chair.jpg
is what im using.
The error is from tf.learn.latest_checkpoint
@ricking06 That looks like a different issue.
Could you file a new issue, with a more complete stack trace, and reproduction instructions?
@ProgramItUp Is the issue referenced by this issue resolved?
Can we close it?
@gunan #974 filled
I am using tensorflow 0.12. I had the same issue
bazel-bin/im2txt/train --input_file_pattern="${MSCOCO_DIR}/train-?????-of-00256" --inception_checkpoint_file="${INCEPTION_CHECKPOINT}" --train_dir="${MODEL_DIR}/train" --train_inception=false --number_of_steps=1000000
INFO:tensorflow:Prefetching values from 256 files matching data/mscoco/train-?????-of-00256
Traceback (most recent call last):
File "/media/hajira/NewVolume/im2txt_test/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 114, in
tf.app.run()
File "/home/hajira/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/media/hajira/NewVolume/im2txt_test/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 65, in main
model.build()
File "/media/hajira/NewVolume/im2txt_test/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 356, in build
self.build_model()
File "/media/hajira/NewVolume/im2txt_test/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 247, in build_model
lstm_cell = tf.contrib.rnn.BasicLSTMCell(
AttributeError: 'module' object has no attribute 'BasicLSTMCell'
_I also tried the code change recommended in
tensorflow/tensorflow#6432
then i Got new error_
stm_cell = tf.contrib.rnn.DropoutWrapper(
AttributeError: 'module' object has no attribute 'DropoutWrapper'
@nealwu did we upgrade this model to TF 1.0?
I am getting this error when I am running show_and_tell_model.py from github tf.losses.add_loss(loss,batch_loss)
NameError: global name 'loss' is not defined
tensorflow version is '1.0.1'
and python using is 2.7.12
Hi everyone, we just merged several big changes to make this repository compatible with TensorFlow 1.0. If you still have issues with the latest model code with the latest version of TensorFlow (ideally 1.0.1), please let me know.
Closing this now. If anyone is still having issues, feel free to reopen or create a new issue.
Still facing the same issue as mentioned by @hajrakomal
Tensorflow : 0.12.1
Python: 2.7.6
bazel-bin/im2txt/train --input_file_pattern="/data/gpuuser2/models/output/sample/train-?????-of-00256" --inception_checkpoint_file="${INCEPTION_CHECKPOINT}" --train_dir="${MODEL_DIR}/train" --train_inception=false --number_of_steps=100
INFO:tensorflow:Prefetching values from 4 files matching /data/gpuuser2/models/output/sample/train-?????-of-00256
Traceback (most recent call last):
File "/data/gpuuser2/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 114, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/data/gpuuser2/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 65, in main
model.build()
File "/data/gpuuser2/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 356, in build
self.build_model()
File "/data/gpuuser2/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 250, in build_model
lstm_cell = tf.contrib.rnn.DropoutWrapper(
AttributeError: 'module' object has no attribute 'DropoutWrapper'
@jeetp465 please upgrade to TensorFlow 1.0. https://www.tensorflow.org/install/
@jeetp465 Alternatively you can clone the repository at commit f653bd2
git clone https://github.com/tensorflow/models.git
git reset --hard f653bd2
Most helpful comment
To fix tf.split issue replace:
_state_tuple = tf.split(value=state_feed, num_or_size_splits=2, axis=1)_
with
_state_tuple = tf.split(split_dim=1, num_split=2, value=state_feed)_