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

getting this error trying to execute model_main_tf2.py file. please help #8851

Open
rkpawar0995 opened this issue Jul 13, 2020 · 6 comments
Open

Comments

@rkpawar0995
Copy link

Traceback (most recent call last):
File "model_main.py", line 108, in
tf.app.run()
File "/home/rahul/anaconda3/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/rahul/.local/lib/python3.7/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/home/rahul/.local/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "model_main.py", line 70, in main
FLAGS.sample_1_of_n_eval_on_train_examples))
File "/home/rahul/models/research/object_detection/model_lib.py", line 746, in create_estimator_and_inputs
pipeline_config_path, config_override=config_override)
File "/home/rahul/models/research/object_detection/utils/config_util.py", line 139, in get_configs_from_pipeline_file
text_format.Merge(proto_str, pipeline_config)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 734, in Merge
allow_unknown_field=allow_unknown_field)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 802, in MergeLines
return parser.MergeLines(lines, message)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 827, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 849, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 974, in _MergeField
merger(tokenizer, message, field)
File "/home/rahul/anaconda3/lib/python3.7/site-packages/google/protobuf/text_format.py", line 1047, in _MergeMessageField
raise tokenizer.ParseErrorPreviousToken('Expected "%s".' % (end_token,))
google.protobuf.text_format.ParseError: 197:1 : Expected "}".

@syiming
Copy link
Contributor

syiming commented Jul 13, 2020

Hi, It seems the error is related to your config file. Possibly a '}' is missing. Could you please share which config file you are using? Thanks!

@syiming syiming added the models:research models that come under research directory label Jul 13, 2020
@rkpawar0995
Copy link
Author

Thank You got it actually eval_input_reader }.was missing. Really Appreciate your response.

@rkpawar0995
Copy link
Author

AttributeError: 'WeightSharedConvolutionalBoxPredictor' object has no attribute 'inputs'

@pkulzc
Copy link
Contributor

pkulzc commented Jul 14, 2020

Please provide more info about your error. I can't tell anything from that AttributeError.

@BharathKR
Copy link

@pkulzc @rkpawar0995 even i'm getting the similar error

after trying to train the model using below code
python model_main.py --pipeline_config_path=ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/pipeline.config --model_dir=training/ --logtostderr

I get the below error..
Traceback (most recent call last):
File "model_main.py", line 108, in
tf.app.run()
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/opt/conda/lib/python3.7/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/opt/conda/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "model_main.py", line 104, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 472, in train_and_evaluate
return executor.run()
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
return self.run_local()
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
saving_listeners=saving_listeners)
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 349, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1182, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1211, in _train_model_default
self.config)
File "/home/jupyter/.local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1170, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/jupyter/.local/lib/python3.7/site-packages/object_detection/model_lib.py", line 543, in model_fn
update_ops=detection_model.updates(),
File "/home/jupyter/.local/lib/python3.7/site-packages/object_detection/meta_architectures/ssd_meta_arch.py", line 1350, in updates
self._box_predictor.inputs))
AttributeError: 'WeightSharedConvolutionalBoxPredictor' object has no attribute 'inputs'

@JunbongJang
Copy link

Running model_main_tf2.py instead of model_main.py solved the problem (AttributeError: 'WeightSharedConvolutionalBoxPredictor' object has no attribute 'inputs') for me.

@jaeyounkim jaeyounkim added models:research:odapi ODAPI and removed models:research models that come under research directory labels Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants