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

TypeError: 'PrefetchDataset' object is not subscriptable #1

Open
lianjili123 opened this issue Aug 9, 2018 · 1 comment
Open

TypeError: 'PrefetchDataset' object is not subscriptable #1

lianjili123 opened this issue Aug 9, 2018 · 1 comment

Comments

@lianjili123
Copy link

deer TropComplique:
When I run train.py, a TypeError arised like:
INFO:tensorflow:Using config: {'_num_ps_replicas': 0, '_tf_random_seed': None, '_save_checkpoints_steps': None, '_model_dir': '/home/dan/work/light-head-rcnn/models/run01/', '_keep_checkpoint_every_n_hours': 10000, '_is_chief': True, '_task_type': 'worker', '_log_step_count_steps': 100, '_save_summary_steps': 200, '_master': '', '_task_id': 0, '_session_config': gpu_options {
visible_device_list: "0"
}
, '_service': None, '_num_worker_replicas': 1, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f67bdd7c6a0>, '_keep_checkpoint_max': 5, '_save_checkpoints_secs': 600}
INFO:tensorflow:Running training and evaluation locally (non-distributed).
INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after 3600 secs (eval_spec.throttle_secs) or training is finished.
Traceback (most recent call last):
File "/home/lianji/light-head-rcnn-master/train.py", line 68, in
tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec)
File "/home/lianji/anaconda2/envs/shufflenetv2/lib/python3.5/site-packages/tensorflow/python/estimator/training.py", line 430, in train_and_evaluate
executor.run_local()
File "/home/lianji/anaconda2/envs/shufflenetv2/lib/python3.5/site-packages/tensorflow/python/estimator/training.py", line 609, in run_local
hooks=train_hooks)
File "/home/lianji/anaconda2/envs/shufflenetv2/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 302, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/home/lianji/anaconda2/envs/shufflenetv2/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 711, in _train_model
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "/home/lianji/anaconda2/envs/shufflenetv2/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 694, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/lianji/light-head-rcnn-master/model.py", line 25, in model_fn
detector = Detector(features['images'], feature_extractor, is_training, params)
TypeError: 'PrefetchDataset' object is not subscriptable
Can you tell me how can solve it?

@TropComplique
Copy link
Owner

Do you use tensorflow 1.9 ?

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

2 participants