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

AttributeError: 'TrainConfig' object has no attribute 'update_trainable_variables' when running object detection #5109

Closed
arijun opened this issue Aug 16, 2018 · 2 comments
Assignees

Comments

@arijun
Copy link

arijun commented Aug 16, 2018

I'm trying to run very basic object detection locally on my CPU, based on the tutorial (just using different images)

Just fetched the latest to solve an (I assume) unrelated problem, and got the following traceback:

Traceback (most recent call last):
  File "object_detection/model_main.py", line 101, in <module>
    tf.app.run()
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "object_detection/model_main.py", line 97, in main
    tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/training.py", line 451, in train_and_evaluate
    return executor.run()
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/training.py", line 590, in run
    return self.run_local()
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/training.py", line 691, in run_local
    saving_listeners=saving_listeners)
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 376, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 1145, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 1170, in _train_model_default
    features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
  File "/home/ari/miniconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 1133, in _call_model_fn
    model_fn_results = self._model_fn(features=features, **kwargs)
  File "/home/ari/models/research/object_detection/model_lib.py", line 320, in model_fn
    if train_config.update_trainable_variables else None)
AttributeError: 'TrainConfig' object has no attribute 'update_trainable_variables'

I tried doing a pip install --upgrade of tensorflow, which moved me from 1.9 to 1.10, it didn't help.

I assume it's expecting some modification to the pipeline configuration file which I haven't made. But since it's not in the sample .config files, and since there is no documentation for those files as far as I can tell, I'm not sure how to fix it.

As a band-aid I just reverted the offending code in model_lib.py, which got me past that error.

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
    No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    Ubuntu 18.04 on Windows
  • TensorFlow installed from (source or binary):
    Pip install
  • TensorFlow version (use command below):
    v1.10.0-0-g656e7a2b34 1.10.0
  • CUDA/cuDNN version:
    N/A
  • GPU model and memory:
    N/A
  • Exact command to reproduce:
~/models/research$ python object_detection/model_main.py     --pipeline_config_path=${PIPELINE_CONFIG_PATH}     --model_dir=${MODEL_DIR}     --num_train_steps=${NUM_TRAIN_STEPS}     --num_eval_steps=${NUM_EVAL_STEPS}     --alsologtostderr
You can collect some of this information using our environment capture script:
@alachyankar
Copy link

Try running the protoc command on the object detection code again. I had a similar problem and running that helped me to get that resolved.

@tensorflowbutler
Copy link
Member

Hi There,
We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing.
If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants