MaxZhang
MaxZhang

Reputation: 53

error when training im2txt model

I was trying to train the im2txt model using Tensorflow that I just built from master branch,

I downloaded all the data sets it needed but when I run the training script:

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

It shows the following:

Traceback (most recent call last): 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 111, in  tf.app.run() 
File "/home/rvl224/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run sys.exit(main(sys.argv[:1] + flags_passthrough)) 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/train.py", line 65, in main model.build() 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 358, in build self.build_inputs() 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 165, in build_inputs image = self.process_image(encoded_image, thread_id=thread_id) 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/show_and_tell_model.py", line 119, in process_image image_format=self.config.image_format) 
File "/home/rvl224/models/im2txt/bazel-bin/im2txt/train.runfiles/im2txt/im2txt/ops/image_processing.py", line 114, in process_image method=tf.image.ResizeMethod.BILINEAR)
TypeError: resize_images() got an unexpected keyword argument 'new_height'

Is it a problem related to the function resize_images() or I just done something wrong?

Thanks

Upvotes: 2

Views: 2367

Answers (1)

Chris Shallue
Chris Shallue

Reputation: 56

Update: fix applied

Sorry about this! The signature of the function resize_images(...) in TensorFlow was changed last week, which caused this breakage.

I will get a fix in for this shortly. If you would like to use the fix before then, you need to modify the file im2txt/im2txt/ops/image_processing.py.

Simply change this line:

image = tf.image.resize_images(image,
                               new_height=resize_height,
                               new_width=resize_width,
                               method=tf.image.ResizeMethod.BILINEAR)

to this:

image = tf.image.resize_images(image,
                               size=[resize_height, resize_width],
                               method=tf.image.ResizeMethod.BILINEAR)

Upvotes: 4

Related Questions