gpt4 book ai didi

python - 训练 im2txt 模型时出错

转载 作者:行者123 更新时间:2023-11-28 22:33:40 30 4
gpt4 key购买 nike

我正在尝试使用刚从 master 分支构建的 Tensorflow 训练 im2txt 模型,

我下载了它需要的所有数据集,但是当我运行训练脚本时:

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

显示如下:

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'

resize_images() 函数的问题还是我做错了什么?

谢谢

最佳答案

更新: fix applied

对此感到抱歉!上周更改了 TensorFlow 中函数 resize_images(...) 的签名,这导致了此损坏。

我会尽快解决这个问题。如果您想在此之前使用修复程序,则需要修改文件 im2txt/im2txt/ops/image_processing.py。

只需更改这一行:

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

为此:

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

关于python - 训练 im2txt 模型时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39672514/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com