Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 训练IM2Text模型时出错_Python_Tensorflow_Deep Learning - Fatal编程技术网

Python 训练IM2Text模型时出错

Python 训练IM2Text模型时出错,python,tensorflow,deep-learning,Python,Tensorflow,Deep Learning,我试着用Tensorflow来训练IM2Text模型,我刚从master branch建立了这个模型 我下载了所需的所有数据集,但在运行培训脚本时: bazel-bin/im2txt/train \ --input_file_pattern="${MSCOCO_DIR}/train-?????-of-00256" \ --inception_checkpoint_file="${INCEPTION_CHECKPOINT}" \ --train_dir="${MODEL_DIR}/train" \

我试着用Tensorflow来训练IM2Text模型,我刚从master branch建立了这个模型

我下载了所需的所有数据集,但在运行培训脚本时:

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相关的问题,还是我刚刚做错了什么

谢谢更新:

对不起!函数resize_images的签名。。。上周,TensorFlow发生了变化,导致了这次断裂

我很快就会解决这个问题。如果希望在此之前使用修复程序,则需要修改文件im2text/im2text/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)