博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tensorflow 1.5 TypeError: __init__() got an unexpected keyword argument 'dct_method'
阅读量:3512 次
发布时间:2019-05-20

本文共 2864 字,大约阅读时间需要 9 分钟。

在运行 objection_detection 下的train进行训练的时候报错 如下:

D:\software\Anaconda\envs\py3\python.exe E:/tensorflow-relevant-download/light_dection/object_detection/train.py --logtostderr --pipeline_config_path=../models/model/ssd_mobilenet_v1_pets.config --train_dir=../models/model/trainWARNING:tensorflow:From E:\tensorflow-relevant-download\light_dection\object_detection\trainer.py:228: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.Instructions for updating:Please switch to tf.train.create_global_stepTraceback (most recent call last):  File "E:/tensorflow-relevant-download/light_dection/object_detection/train.py", line 155, in 
tf.app.run() File "D:\software\Anaconda\envs\py3\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run _sys.exit(main(argv)) File "E:/tensorflow-relevant-download/light_dection/object_detection/train.py", line 151, in main worker_job_name, is_chief, FLAGS.train_dir) File "E:\tensorflow-relevant-download\light_dection\object_detection\trainer.py", line 235, in train train_config.prefetch_queue_capacity, data_augmentation_options) File "E:\tensorflow-relevant-download\light_dection\object_detection\trainer.py", line 59, in create_input_queue tensor_dict = create_tensor_dict_fn() File "E:/tensorflow-relevant-download/light_dection/object_detection/train.py", line 108, in get_next dataset_builder.build(config)).get_next() File "E:\tensorflow-relevant-download\light_dection\object_detection\builders\dataset_builder.py", line 138, in build label_map_proto_file=label_map_proto_file) File "E:\tensorflow-relevant-download\light_dection\object_detection\data_decoders\tf_example_decoder.py", line 110, in __init__ dct_method=dct_method),TypeError: __init__() got an unexpected keyword argument 'dct_method'Process finished with exit code 1

stack overflow 提到解决方案

tensorflow issue也再次提到.

具体解决方案如下

This error is due to the incompatibility of file tf_example_decoder.py with the Tensorflow installed.

In file models/research/object_detection/data_decoders/tf_example_decoder.py:

line 28:

slim_example_decoder = tf.contrib.slim.tfexample_decoder

line 104:

self.items_to_handlers = {

fields.InputDataFields.image:
slim_example_decoder.Image(
image_key=’image/encoded’,
format_key=’image/format’,
channels=3,
dct_method=dct_method),….
…..
….
..
.
}
slim_example_decoder.Image is tf.contrib.slim.tfexample_decoder.Image

In Tensorflow 1.5 source code tf.contrib.slim.tfexample_decoder.Image doesn’t have dct_method argument. Therefore when dct_method argument is passed it throws an error.

A simple hack would be to not pass this argument. So edit tf_example_decoder.py line 110 to remove dct_method=dct_method. I tried this and it worked and didn’t had any effect on training.

将 dct_method=dct_method 给去掉.

转载地址:http://yfzqj.baihongyu.com/

你可能感兴趣的文章
实习日志一
查看>>
Hibernate的NonUnique异常
查看>>
排序算法稳定性
查看>>
图算法总结(判断有环、最短路径)
查看>>
java中的SecurityManager类
查看>>
spring中的类
查看>>
PHP——水印处理
查看>>
PHP——缩放与裁剪
查看>>
‘type’属性值
查看>>
Python精典习题 ——— 有 1,2,3,4 ,这几个数字。能组成多少个互不相同的且无重复的三位数呢?
查看>>
python精典习题——输入某年某月某日,判断这一天是这一年的第几天?
查看>>
谈谈你对Java平台的理解?
查看>>
java安装教程
查看>>
IDEA的安装 (长期稳定)
查看>>
VM之 CentOS7安装
查看>>
自学笔记 — Java入门1
查看>>
Java自学笔记 — 面向对象1
查看>>
LC_寻找数组的中心索引
查看>>
Java自学笔记 — 面向对象2
查看>>
Java自学笔记 — 面向对象3
查看>>