Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While upgrade TensorFlow to 1.5, then training own data-set throwing the following error #3421

Closed
Bahramudin opened this issue Feb 22, 2018 · 11 comments
Assignees
Labels
stat:awaiting response Waiting on input from the contributor

Comments

@Bahramudin
Copy link

Bahramudin commented Feb 22, 2018

System information

  • What is the top-level directory of the model you are using: object detection
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): v1.5.0-0-g37aa430d84 1.5.0
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version: using CPU
  • GPU model and memory: using CPU
  • Exact command to reproduce:

Describe the problem

I want to train my own dataset using TensorFlow object detection. I have already done everything step by step (collecting data, mark objects, create TF records) it was done without any problem, and when I was using TensorFLow 1.4 to train the dataset by using ssd_mobilenet_v1_coco_2017_11_17, everything goes well with out any problem, but when I upgrade it to 1.5, then I am getting below error:

WARNING:tensorflow:From /home/adil/workspace/tensorflow/models-working/research/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_step
Traceback (most recent call last):
File "train.py", line 167, in
tf.app.run()
File "/home/adil/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "train.py", line 163, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/adil/workspace/tensorflow/models/research/object_detection/trainer.py", line 235, in train
train_config.prefetch_queue_capacity, data_augmentation_options)
File "/home/adil/workspace/tensorflow/models/research/object_detection/trainer.py", line 59, in create_input_queue
tensor_dict = create_tensor_dict_fn()
File "train.py", line 120, in get_next
dataset_builder.build(config)).get_next()
File "/home/adil/workspace/tensorflow/models/research/object_detection/builders/dataset_builder.py", line 138, in build
label_map_proto_file=label_map_proto_file)
File "/home/adil/workspace/tensorflow/models-working/research/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'

Note: I have already updated (reinstalled) everything.

@Paspartout
Copy link

I had the same problem since yesterday.

It looks like the pull request merged in be9b802
caused some problems. After checking out the version before that commit everything worked fine.

@Bahramudin
Copy link
Author

@Paspartout Hmmm, today when I installed everything from the latest (TensorFlow and Models) everything goes well, but while starting to train, got this problem, but I have tried to solve it by my self or by searching on the internet, but none of them has solved the problem. Here is a stack overflow question also issuing the same problem.

@RonakDedhiya
Copy link

Facing out same problem

@Lisandro79
Copy link

Same problem here.

@ghost
Copy link

ghost commented Feb 22, 2018

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.

@bignamehyp
Copy link
Member

@nathansilberman can you please take a look? Thanks

@bignamehyp bignamehyp added the stat:awaiting model gardener Waiting on input from TensorFlow model gardener label Feb 22, 2018
@pkulzc
Copy link
Contributor

pkulzc commented Feb 23, 2018

@harshitladdha is right, this code depends on latest tf.contrib.slim.tfexample_decoder, which does not exist in tf 1.5. A fix will be applied soon.

@nguyeho7
Copy link

Another workaround is to install tf-nightly (version 1.7)

@ybsave
Copy link

ybsave commented Mar 5, 2018

But there is no recent nightly built version for Windows users that has the 'dct_method' version. The last successful windows nightly built is almost one month ago!

@tensorflowbutler tensorflowbutler removed the stat:awaiting model gardener Waiting on input from TensorFlow model gardener label Apr 6, 2018
@ymodak
Copy link
Contributor

ymodak commented Nov 21, 2018

@Bahramudin Can you please use the latest version of TensorFlow and test again? Thanks!

@ymodak ymodak added the stat:awaiting response Waiting on input from the contributor label Nov 21, 2018
@pkulzc pkulzc self-assigned this Nov 21, 2018
@pkulzc
Copy link
Contributor

pkulzc commented Nov 21, 2018

Please note that Tesnorflow Object Detection now requires tensorflow v 1.9 +.

Closing this since it's we have updated our code base a number of times.

@pkulzc pkulzc closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Waiting on input from the contributor
Projects
None yet
Development

No branches or pull requests

10 participants